提交 a871d7a7 编写于 作者: A anthony

7159266: [macosx] ApplicationDelegate should not be set in the headless mode

Summary: Don't install ApplicationDelegate in headless mode
Reviewed-by: art, serb
上级 b53a91fe
...@@ -312,15 +312,17 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -312,15 +312,17 @@ AWT_ASSERT_APPKIT_THREAD;
if (verbose) AWT_DEBUG_LOG(@"got out of the AppKit startup mutex"); if (verbose) AWT_DEBUG_LOG(@"got out of the AppKit startup mutex");
} }
// Don't set the delegate until the NSApplication has been created and if (!headless) {
// its finishLaunching has initialized it. // Don't set the delegate until the NSApplication has been created and
// ApplicationDelegate is the support code for com.apple.eawt. // its finishLaunching has initialized it.
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ // ApplicationDelegate is the support code for com.apple.eawt.
id<NSApplicationDelegate> delegate = [ApplicationDelegate sharedDelegate]; [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
if (delegate != nil) { id<NSApplicationDelegate> delegate = [ApplicationDelegate sharedDelegate];
OSXAPP_SetApplicationDelegate(delegate); if (delegate != nil) {
} OSXAPP_SetApplicationDelegate(delegate);
}]; }
}];
}
} }
- (void)starter:(NSArray*)args { - (void)starter:(NSArray*)args {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册