mac: Clears the delegate when window is going to be closed
Since EL Capitan it is possible that the methods of delegate would get called after the window has been closed. Refs atom/atom#9584.
This commit is contained in:
parent
8ce19d8059
commit
6c1878d15b
1 changed files with 5 additions and 0 deletions
|
@ -192,6 +192,11 @@ bool ScopedDisableResize::disable_resize_ = false;
|
|||
|
||||
- (void)windowWillClose:(NSNotification*)notification {
|
||||
shell_->NotifyWindowClosed();
|
||||
|
||||
// Clears the delegate when window is going to be closed, since EL Capitan it
|
||||
// is possible that the methods of delegate would get called after the window
|
||||
// has been closed.
|
||||
[shell_->GetNativeWindow() setDelegate:nil];
|
||||
}
|
||||
|
||||
- (BOOL)windowShouldClose:(id)window {
|
||||
|
|
Loading…
Reference in a new issue