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:
parent
9fd5a64cd8
commit
e3c64d7971
1 changed files with 3 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue