[android] Create a new local reference frame to avoid a local reference table overflow

Fixes #4706
This commit is contained in:
Antonio Zugaldia
2016-05-02 17:34:28 -04:00
parent 78584b7fed
commit 7d1a4c5ec1

View File

@@ -1508,6 +1508,10 @@ void setOfflineRegionObserver(JNIEnv *env, jni::jobject* offlineRegion_, jni::jo
break;
}
// Create a new local reference frame (capacity 1 for the NewObject allocation below)
// to avoid a local reference table overflow (#4706)
jni::UniqueLocalFrame frame = jni::PushLocalFrame(*env2, 1);
// Stats object
jni::jobject* jstatus = &jni::NewObject(*env2, *offlineRegionStatusClass, *offlineRegionStatusConstructorId);
jni::SetField<jint>(*env2, jstatus, *offlineRegionStatusDownloadStateId, downloadState);