From 679959eeb5796327a411fd475bbbcd5c4bfb4741 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 25 Mar 2014 16:58:34 +0800 Subject: [PATCH] BrowserWindow.destroy() should not delete window immediately. It could cause crash when context menu is showing. --- atom/browser/api/atom_api_window.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index e8a845ff6a..d9bd698d93 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -127,7 +127,7 @@ void Window::Destroy(const v8::FunctionCallbackInfo& args) { UNWRAP_WINDOW_AND_CHECK; base::ProcessHandle handle = self->window_->GetRenderProcessHandle(); - delete self; + base::MessageLoop::current()->DeleteSoon(FROM_HERE, self); // Make sure the renderer process is terminated, it could happen that the // renderer process became a zombie.