Release the native window after window gets closed

Previously we delete the window after the JS object gets garbage
collected, which is too late for releasing some resources.
This commit is contained in:
Cheng Zhao 2015-09-17 11:30:17 +08:00
parent 9fd5a64cd8
commit e3c64d7971

View file

@ -116,6 +116,9 @@ void Window::OnWindowClosed() {
window_->RemoveObserver(this);
Emit("closed");
// Clean up the resources after window has been closed.
base::MessageLoop::current()->DeleteSoon(FROM_HERE, window_.release());
}
void Window::OnWindowBlur() {