--- old/src/macosx/native/sun/awt/awt.m 2013-01-15 11:31:21.000000000 +0400 +++ new/src/macosx/native/sun/awt/awt.m 2013-01-15 11:31:21.000000000 +0400 @@ -310,14 +310,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 {