Do not receive notifications after window is closed, fixes #265.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 9 May 2014 01:47:11 +0000 (09:47 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 9 May 2014 01:47:11 +0000 (09:47 +0800)
atom/browser/native_window.cc

index 79b024e..f7f069a 100644 (file)
@@ -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);
 }