8229515: [macos] access to window property of NSView on wrong thread
authorserb
Sat, 07 Sep 2019 11:38:36 -0700
changeset 58320 3020baa4efa4
parent 58319 18e7ed2cd7d1
child 58321 7f55aad34ac4
8229515: [macos] access to window property of NSView on wrong thread Reviewed-by: prr, dmarkov
src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m	Wed Sep 04 10:12:42 2019 +0200
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m	Sat Sep 07 11:38:36 2019 -0700
@@ -1408,10 +1408,8 @@
     JNF_COCOA_ENTER(env);
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    NSWindow *window = [view window];
-
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-
+        NSWindow *window = [view window];
         ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
     }];