-1

I have a big problem.

I have a method where I catch a JObjectArray strings and populate a vector of strings, because the vector will be used in a piece of code that is reused in version for application PC.

string linha("");
for (int i = 0; i < tamanhoArray; i++) {
    jstring jLinha = (jstring)env->GetObjectArrayElement(objArray, i);
    const char * charArray = env->GetStringUTFChars(jLinha, NULL );
    if (charArray != NULL)
        linha = string(charArray);
    env->ReleaseStringUTFChars(jLinha, charArray);
    pLista.push_back(linha);
}

The method is performed several times during the execution of the application, but always at a certain point on line 13 (I got debug with "log") for the application and displays logcat "(bug app): Local reference table overflow". Has anyone experienced this problem?

Carl Manaster
  • 39,912
  • 17
  • 102
  • 155
  • possible duplicate of [Android NDK overflows dalvik JNI local reference table](http://stackoverflow.com/questions/11079912/android-ndk-overflows-dalvik-jni-local-reference-table) – BlamKiwi Feb 18 '15 at 00:32

1 Answers1

0

Because you do not delete local references obtained from the array:

env->DeleteLocalRef(jLinha);
StenSoft
  • 9,369
  • 25
  • 30