8011686: AWT accidentally disables the NSApplicationDelegate of SWT, causing loss of OS X integration functionality
authorpchelko
Thu, 18 Apr 2013 15:09:59 +0100
changeset 17142 ccc30e8c6d91
parent 16843 21ec7ce3e580
child 17143 8c04982f62b3
8011686: AWT accidentally disables the NSApplicationDelegate of SWT, causing loss of OS X integration functionality Reviewed-by: anthony, serb Contributed-by: Markus Persson <markus.persson@oracle.com>
jdk/src/macosx/native/sun/awt/awt.m
--- a/jdk/src/macosx/native/sun/awt/awt.m	Wed Apr 17 11:24:40 2013 -0700
+++ b/jdk/src/macosx/native/sun/awt/awt.m	Thu Apr 18 15:09:59 2013 +0100
@@ -316,7 +316,10 @@
     // its finishLaunching has initialized it.
     //  ApplicationDelegate is the support code for com.apple.eawt.
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        OSXAPP_SetApplicationDelegate([ApplicationDelegate sharedDelegate]);
+        id<NSApplicationDelegate> delegate = [ApplicationDelegate sharedDelegate];
+        if (delegate != nil) {
+            OSXAPP_SetApplicationDelegate(delegate);
+        }        
     }];
 }