Free window object immediately in destory().
authorCheng Zhao <zcbenz@gmail.com>
Wed, 26 Mar 2014 01:58:40 +0000 (09:58 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 26 Mar 2014 01:58:40 +0000 (09:58 +0800)
This put everything back to the original design, since now it's not
possible to destory a window while a context menu is showing.

atom/browser/api/atom_api_window.cc

index 3d76592..e8a845f 100644 (file)
@@ -127,9 +127,7 @@ void Window::Destroy(const v8::FunctionCallbackInfo<v8::Value>& args) {
   UNWRAP_WINDOW_AND_CHECK;
 
   base::ProcessHandle handle = self->window_->GetRenderProcessHandle();
-  // Just destroy the NativeWindow object, the api::Window object would be
-  // deleted in the coming OnWindowClosed event.
-  self->window_.reset();
+  delete self;
 
   // Make sure the renderer process is terminated, it could happen that the
   // renderer process became a zombie.