From d7261073e78329611e96b698d11960ac7d4f76d9 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 26 Mar 2014 09:58:40 +0800 Subject: [PATCH] Free window object immediately in destory(). 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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index 3d765927..e8a845ff 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -127,9 +127,7 @@ void Window::Destroy(const v8::FunctionCallbackInfo& 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. -- 2.43.0