changeset 8063:5d0c891264bf

8010668: builtin JNI libraries should not be unloaded Reviewed-by: chegar, alanb Contributed-by: Bill Pittore <bill.pittore@oracle.com>
author chegar
date Mon, 25 Mar 2013 14:29:13 +0000
parents d92a96dcbfe1
children 5e383a73386a
files src/share/native/java/lang/ClassLoader.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/java/lang/ClassLoader.c	Mon Mar 25 19:25:01 2013 +0530
+++ b/src/share/native/java/lang/ClassLoader.c	Mon Mar 25 14:29:13 2013 +0000
@@ -398,7 +398,9 @@
         if (cause) {
             (*env)->ExceptionClear(env);
             (*env)->Throw(env, cause);
-            JVM_UnloadLibrary(handle);
+            if (!isBuiltin) {
+                JVM_UnloadLibrary(handle);
+            }
             goto done;
         }
 
@@ -409,7 +411,9 @@
                          "unsupported JNI version 0x%08X required by %s",
                          jniVersion, cname);
             JNU_ThrowByName(env, "java/lang/UnsatisfiedLinkError", msg);
-            JVM_UnloadLibrary(handle);
+            if (!isBuiltin) {
+                JVM_UnloadLibrary(handle);
+            }
             goto done;
         }
         (*env)->SetIntField(env, this, jniVersionID, jniVersion);
@@ -458,7 +462,9 @@
         (*env)->GetJavaVM(env, &jvm);
         (*JNI_OnUnload)(jvm, NULL);
     }
-    JVM_UnloadLibrary(handle);
+    if (!isBuiltin) {
+        JVM_UnloadLibrary(handle);
+    }
     JNU_ReleaseStringPlatformChars(env, name, cname);
 }