提交 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;
if (verbose) AWT_DEBUG_LOG(@"got out of the AppKit startup mutex");
}
// 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.
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
id<NSApplicationDelegate> delegate = [ApplicationDelegate sharedDelegate];
if (delegate != nil) {
OSXAPP_SetApplicationDelegate(delegate);
}
}];
if (!headless) {
// 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.
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
id<NSApplicationDelegate> delegate = [ApplicationDelegate sharedDelegate];
if (delegate != nil) {
OSXAPP_SetApplicationDelegate(delegate);
}
}];
}
}
- (void)starter:(NSArray*)args {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册