Skip to content

Commit

Permalink
prevent local reference table overflow - part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhvh committed Nov 11, 2015
1 parent 5000b10 commit 620a655
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/java/TypesUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ static jobject hashmapObjectToJavaConverter(JNIEnv * env, Object * obj)
jmethodID method = env->GetMethodID(cls, "put", "(Ljava/lang/Object;Ljava/lang/Object;)V");
Array * keys = hashMap->allKeys();
for(unsigned int i = 0 ; i < keys->count() ; i ++) {
PushLocalFrame(env, 32);
env->PushLocalFrame(32);
Object * key = keys->objectAtIndex(i);
jobject javaKey = mcObjectToJava(env, key);
Object * value = hashMap->objectForKey(key);
jobject javaValue = mcObjectToJava(env, value);
env->CallVoidMethod(javaHashMap, method, javaKey, javaValue);
PopLocalFrame(env, NULL);
env->PopLocalFrame(NULL);
}
return javaHashMap;
}
Expand All @@ -240,13 +240,13 @@ static jobject arrayObjectToJavaConverter(JNIEnv * env, Object * obj)
jmethodID method = env->GetMethodID(cls, "add", "(Ljava/lang/Object;)Z");
MCLog("add method %p", method);
for(unsigned int i = 0 ; i < array->count() ; i ++) {
PushLocalFrame(env, 32);
env->PushLocalFrame(32);
MCLog("converting object %s", MCUTF8(array->objectAtIndex(i)));
jobject javaObject = mcObjectToJava(env, array->objectAtIndex(i));
MCLog("add object %p", javaObject);
env->CallBooleanMethod(javaVector, method, javaObject);
MCLog("added object %p", javaObject);
PopLocalFrame(env, NULL);
env->PopLocalFrame(NULL);
}
MCLog("array converted");
return javaVector;
Expand Down

0 comments on commit 620a655

Please sign in to comment.