fix: handle closing webContents in BrowserViews (#37420)

* fix: handle closing webContents in BrowserViews

* test: add window.close() test
This commit is contained in:
Shelley Vohr 2023-03-01 11:35:06 +01:00 committed by GitHub
parent 8fb0f43030
commit 5e25d23794
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 5 deletions

View file

@ -126,6 +126,9 @@ BrowserView::~BrowserView() {
}
void BrowserView::WebContentsDestroyed() {
if (owner_window())
owner_window()->window()->RemoveDraggableRegionProvider(this);
api_web_contents_ = nullptr;
web_contents_.Reset();
Unpin();