Skip to content

Commit

Permalink
fix: crash in BrowserWindow destructor after win.webContents.destroy()
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak committed Jun 7, 2019
1 parent abab90f commit b1e9fd1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions atom/browser/api/atom_api_browser_window.cc
Expand Up @@ -94,11 +94,12 @@ BrowserWindow::BrowserWindow(v8::Isolate* isolate,
}

BrowserWindow::~BrowserWindow() {
api_web_contents_->RemoveObserver(this);
// Note that the OnWindowClosed will not be called after the destructor runs,
// since the window object is managed by the TopLevelWindow class.
if (web_contents())
if (web_contents()) {
api_web_contents_->RemoveObserver(this);
Cleanup();
}
}

void BrowserWindow::OnInputEvent(const blink::WebInputEvent& event) {
Expand Down

0 comments on commit b1e9fd1

Please sign in to comment.