mac: Clean delegate before releasing window

This commit is contained in:
Cheng Zhao 2014-11-03 22:12:33 +08:00
parent b75dc9b08d
commit dbfa9b5660

View file

@ -68,6 +68,7 @@ using namespace brightray;
[devtools_window_ makeKeyAndOrderFront:nil];
} else {
[[self window] makeKeyAndOrderFront:nil];
[devtools_window_ setDelegate:nil];
[devtools_window_ close];
devtools_window_.reset();
}
@ -146,7 +147,6 @@ using namespace brightray;
#pragma mark - NSWindowDelegate
- (void)windowWillClose:(NSNotification*)notification {
[devtools_window_ setDelegate:nil];
inspectableWebContentsView_->inspectable_web_contents()->CloseDevTools();
}