BrowserWindow.destroy() should not delete window immediately.

It could cause crash when context menu is showing.
This commit is contained in:
Cheng Zhao 2014-03-25 16:58:34 +08:00
parent e96a3abdf9
commit 679959eeb5

View file

@ -127,7 +127,7 @@ void Window::Destroy(const v8::FunctionCallbackInfo<v8::Value>& 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.