Browse Source

jni: avoid crashing when run on ART

The ART runtime is stricter about calling env->DeleteWeakGlobalRef
on an object/value that was not returned from env->NewWeakGlobalRef.
In that case, it triggers an abort which causes the application to
crash and display an "Application has stopped" dialog message.
master
Reece H. Dunn 11 years ago
parent
commit
092318d4df
1 changed files with 0 additions and 2 deletions
  1. 0
    2
      android/jni/jni/eSpeakService.cpp

+ 0
- 2
android/jni/jni/eSpeakService.cpp View File

@@ -227,8 +227,6 @@ JNICALL Java_com_reecedunn_espeak_SpeechSynthesis_nativeDestroy(
if (nat) {
env->DeleteWeakGlobalRef(nat->object);
delete nat;
} else {
env->DeleteWeakGlobalRef(object);
}

return JNI_TRUE;

Loading…
Cancel
Save