mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user