changeset 17142:ccc30e8c6d91

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>
author pchelko
date Thu, 18 Apr 2013 15:09:59 +0100
parents 21ec7ce3e580
children 8c04982f62b3
files jdk/src/macosx/native/sun/awt/awt.m
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);
+        }        
     }];
 }