mirror of
https://github.com/electron/electron.git
synced 2026-01-25 15:28:11 -05:00
Merge pull request #2815 from atom/release-resources
Release the resources of native window immediately when it is closed
This commit is contained in:
@@ -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() {
|
||||
@@ -220,10 +223,8 @@ bool Window::IsDestroyed() const {
|
||||
}
|
||||
|
||||
void Window::Destroy() {
|
||||
if (window_) {
|
||||
if (window_)
|
||||
window_->CloseContents(nullptr);
|
||||
window_.reset();
|
||||
}
|
||||
}
|
||||
|
||||
void Window::Close() {
|
||||
|
||||
2
vendor/brightray
vendored
2
vendor/brightray
vendored
Submodule vendor/brightray updated: d385c9b1b8...f103af2f6b
Reference in New Issue
Block a user