Fix DataStoreGetFunction.

This commit is contained in:
Grant Limberg 2015-05-28 20:37:16 -07:00
parent 58ca657da6
commit b6196a53de

View File

@ -333,10 +333,13 @@ namespace {
if(retval > 0)
{
env->GetByteArrayRegion(bufferObj, 0, retval, (jbyte*)buffer);
env->GetLongArrayRegion(objectSizeObj, 0, 1, (jlong*)out_objectSize);
env->DeleteLocalRef(bufferObj);
env->DeleteLocalRef(objectSizeObj);
jbyte *data = env->GetByteArrayElements(bufferObj, NULL);
memcpy(buffer, data, retval);
env->ReleaseByteArrayElements(bufferObj, data, JNI_ABORT);
jlong *objSize = env->GetLongArrayElements(objectSizeObj, NULL);
*out_objectSize = (unsigned long)objSize[0];
env->ReleaseLongArrayElements(objectSizeObj, objSize, JNI_ABORT);
}
LOGI("Out Object Size: %lu", *out_objectSize);