mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Fix the way to get the JNI env in java wrapper to prevent crashes when some native threads stop.
This commit is contained in:
parent
e2c3e740ec
commit
a5dce40387
1 changed files with 2 additions and 3 deletions
|
|
@ -283,9 +283,8 @@ static inline void handle_possible_java_exception(JNIEnv *env, jobject listener)
|
|||
|
||||
{{#callbacks}}
|
||||
static {{return}} {{callbackName}}({{params}}) {
|
||||
JNIEnv *env = 0;
|
||||
jint jvmResult = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (jvmResult != 0) {
|
||||
JNIEnv *env = ms_get_jni_env();
|
||||
if (!env) {
|
||||
ms_error("cannot attach VM");
|
||||
return{{returnIfFail}};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue