fix datastore get call in JNI

Just delete the local reference rather than do an array delete.  Array delete was causing a crash on loading network config files.  Deleting the local ref works fine, though, as it still lets the JVM garbage collecter know that the native code is done with the array
This commit is contained in:
Grant Limberg 2015-05-26 21:32:56 -07:00
parent 2d67196667
commit 09631ad382

View File

@ -333,10 +333,10 @@ namespace {
if(retval > 0)
{
env->GetByteArrayRegion(bufferObj, 0, bufferSize, (jbyte*)buffer);
env->GetByteArrayRegion(bufferObj, 0, retval, (jbyte*)buffer);
env->GetLongArrayRegion(objectSizeObj, 0, 1, (jlong*)out_objectSize);
env->ReleaseByteArrayElements(bufferObj, (jbyte*)buffer, 0);
env->ReleaseLongArrayElements(objectSizeObj, (jlong*)out_objectSize, 0);
env->DeleteLocalRef(bufferObj);
env->DeleteLocalRef(objectSizeObj);
}
LOGI("Out Object Size: %lu", *out_objectSize);