Commit a5dce403 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Fix the way to get the JNI env in java wrapper to prevent crashes when some native threads stop.

parent e2c3e740
......@@ -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}};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment