Fix "using JNI after critical" exceptions
Refactored ScopedJavaNioBuffer implementation to copy directly to std::vector<uint8_t> instances and release the jni critical array queries immediately after copying into a vector. This is to avoid potential interleavings of JNI method calls before destructor of ScopedJavaNioBuffer is invoked. As per jni requirements no other JNI calls are allowed after GetPrimitiveArrayCritical until a matching call to ReleasePrimitiveArrayCritical is made. Fixes: 271468824 Test: Added tests to MeshTest Change-Id: Ia4afd8b8584ae43f021c79b6a341b05e80e0e205
Loading
Please register or sign in to comment