mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
REVIEW: Delete WidgetDelegate before widget is destroyed.
Ideally widget delegates must outlive their widget, but since we manage the lifetime of native widget, allow the delegate to be destroyed when widget is destroyed. https://chromium-review.googlesource.com/c/chromium/src/+/977244
This commit is contained in:
committed by
Aleksei Kuzmin
parent
9264a00dfd
commit
63006aebe8
@@ -60,7 +60,10 @@ NativeWindow::NativeWindow(const mate::Dictionary& options,
|
||||
|
||||
NativeWindow::~NativeWindow() {
|
||||
// It's possible that the windows gets destroyed before it's closed, in that
|
||||
// case we need to ensure the OnWindowClosed message is still notified.
|
||||
// case we need to ensure the Widget delegate gets destroyed and
|
||||
// OnWindowClosed message is still notified.
|
||||
if (widget_->widget_delegate())
|
||||
widget_->OnNativeWidgetDestroyed();
|
||||
NotifyWindowClosed();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user