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.
This commit is contained in:
Cheng Zhao 2014-03-26 09:58:40 +08:00
parent 01a9ac21a5
commit d7261073e7

View 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.