jdk/src/macosx/native/sun/awt/awt.m
changeset 15322 3638f33225ec
parent 15321 da912a45f4e6
child 17142 ccc30e8c6d91
--- a/jdk/src/macosx/native/sun/awt/awt.m	Fri Jan 18 14:17:11 2013 +0400
+++ b/jdk/src/macosx/native/sun/awt/awt.m	Fri Jan 18 18:17:02 2013 +0400
@@ -315,14 +315,9 @@
     // Don't set the delegate until the NSApplication has been created and
     // its finishLaunching has initialized it.
     //  ApplicationDelegate is the support code for com.apple.eawt.
-    void (^setDelegateBlock)() = ^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         OSXAPP_SetApplicationDelegate([ApplicationDelegate sharedDelegate]);
-    };
-    if (onMainThread) {
-        setDelegateBlock();
-    } else {
-        [JNFRunLoop performOnMainThreadWaiting:YES withBlock:setDelegateBlock];
-    }
+    }];
 }
 
 - (void)starter:(NSArray*)args {