Browse Source

Do not receive notifications after window is closed, fixes #265.

Cheng Zhao 11 years ago
parent
commit
d10292d95c
1 changed files with 4 additions and 0 deletions
  1. 4 0
      atom/browser/native_window.cc

+ 4 - 0
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);
 }