fix: Native window close crash (#15327)
This commit is contained in:
parent
809bd3757b
commit
ca4b4709e5
1 changed files with 5 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
||||||
#include "atom/browser/ui/cocoa/atom_preview_item.h"
|
#include "atom/browser/ui/cocoa/atom_preview_item.h"
|
||||||
#include "atom/browser/ui/cocoa/atom_touch_bar.h"
|
#include "atom/browser/ui/cocoa/atom_touch_bar.h"
|
||||||
#include "base/mac/mac_util.h"
|
#include "base/mac/mac_util.h"
|
||||||
|
#include "ui/views/cocoa/bridged_native_widget.h"
|
||||||
#include "ui/views/widget/native_widget_mac.h"
|
#include "ui/views/widget/native_widget_mac.h"
|
||||||
|
|
||||||
@implementation AtomNSWindowDelegate
|
@implementation AtomNSWindowDelegate
|
||||||
|
@ -246,7 +247,10 @@
|
||||||
// Clears the delegate when window is going to be closed, since EL Capitan it
|
// 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
|
// is possible that the methods of delegate would get called after the window
|
||||||
// has been closed.
|
// has been closed.
|
||||||
[shell_->GetNativeWindow() setDelegate:nil];
|
views::BridgedNativeWidget* bridged_view =
|
||||||
|
views::NativeWidgetMac::GetBridgeForNativeWindow(
|
||||||
|
shell_->GetNativeWindow());
|
||||||
|
bridged_view->OnWindowWillClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)windowShouldClose:(id)window {
|
- (BOOL)windowShouldClose:(id)window {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue