fix: destroy WebContents synchronously on shutdown (#15541)
This commit is contained in:
parent
6162d9090d
commit
746beb0d8b
12 changed files with 122 additions and 13 deletions
|
@ -381,7 +381,9 @@ void BrowserWindow::Cleanup() {
|
|||
if (host)
|
||||
host->GetWidget()->RemoveInputEventObserver(this);
|
||||
|
||||
api_web_contents_->DestroyWebContents(true /* async */);
|
||||
// Destroy WebContents asynchronously unless app is shutting down,
|
||||
// because destroy() might be called inside WebContents's event handler.
|
||||
api_web_contents_->DestroyWebContents(!Browser::Get()->is_shutting_down());
|
||||
Observe(nullptr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue