From d10292d95c4184dd5391e2c956007f6c1cb7bfb7 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 9 May 2014 09:47:11 +0800 Subject: [PATCH] Do not receive notifications after window is closed, fixes #265. --- atom/browser/native_window.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index 79b024ef..f7f069ac 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -357,6 +357,10 @@ void NativeWindow::NotifyWindowClosed() { is_closed_ = true; FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowClosed()); + // Do not receive any notification after window has been closed, there is a + // crash that seems to be caused by this: http://git.io/YqMG5g. + registrar_.RemoveAll(); + WindowList::RemoveWindow(this); } -- 2.43.0