提交 7d4838dc 编写于 作者: C chegar

8010668: builtin JNI libraries should not be unloaded

Reviewed-by: chegar, alanb
Contributed-by: NBill Pittore <bill.pittore@oracle.com>
上级 9c14f067
......@@ -398,7 +398,9 @@ Java_java_lang_ClassLoader_00024NativeLibrary_load
if (cause) {
(*env)->ExceptionClear(env);
(*env)->Throw(env, cause);
if (!isBuiltin) {
JVM_UnloadLibrary(handle);
}
goto done;
}
......@@ -409,7 +411,9 @@ Java_java_lang_ClassLoader_00024NativeLibrary_load
"unsupported JNI version 0x%08X required by %s",
jniVersion, cname);
JNU_ThrowByName(env, "java/lang/UnsatisfiedLinkError", msg);
if (!isBuiltin) {
JVM_UnloadLibrary(handle);
}
goto done;
}
(*env)->SetIntField(env, this, jniVersionID, jniVersion);
......@@ -458,7 +462,9 @@ Java_java_lang_ClassLoader_00024NativeLibrary_unload
(*env)->GetJavaVM(env, &jvm);
(*JNI_OnUnload)(jvm, NULL);
}
if (!isBuiltin) {
JVM_UnloadLibrary(handle);
}
JNU_ReleaseStringPlatformChars(env, name, cname);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册