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.
This commit is contained in:
Reece H. Dunn
2014-07-03 12:11:17 +01:00
parent 9fbc01bed5
commit 092318d4df
-2
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;