8140311: SwingInterop crashes at window close
authorazvegint
Tue, 20 Sep 2016 21:26:33 +0300
changeset 41391 fdd0ab85d1c1
parent 41390 a50c1f9c2244
child 41392 ce5748c8192a
8140311: SwingInterop crashes at window close Reviewed-by: serb, ssadetsky
jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m	Tue Sep 20 12:37:54 2016 +0530
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m	Tue Sep 20 21:26:33 2016 +0300
@@ -117,7 +117,7 @@
 }
 
 - (void)dealloc {
-    JNIEnv *env = [ThreadUtilities getJNIEnv];
+    JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
     if (self.runnable) {
         (*env)->DeleteGlobalRef(env, self.runnable);
     }
@@ -125,7 +125,7 @@
 }
 
 - (void)perform {
-    JNIEnv* env = [ThreadUtilities getJNIEnv];
+    JNIEnv* env = [ThreadUtilities getJNIEnvUncached];
     static JNF_CLASS_CACHE(sjc_Runnable, "java/lang/Runnable");
     static JNF_MEMBER_CACHE(jm_Runnable_run, sjc_Runnable, "run", "()V");
     JNFCallVoidMethod(env, self.runnable, jm_Runnable_run);