]> khamidou — GitHub mirrors - electron.git/commitdiff
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 3d765927c52b8efb8f54e4aa580f2f4247457d3c..e8a845ff6abf9aaa8c07099d2adb5be726ecd0cf 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.