fix: crash calling BrowserWindow.removeBrowserView() with destroyed webContents (#38842)

fix: crash calling removeBrowserView() with destroyed webContents

https://github.com/electron/electron/issues/37642
This commit is contained in:
Shelley Vohr 2023-06-21 21:20:54 +02:00 committed by GitHub
parent ce6fe040fe
commit a00a25376d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 0 deletions

View file

@ -131,6 +131,10 @@ void BrowserView::WebContentsDestroyed() {
Unpin();
}
void BrowserView::OnCloseContents() {
api_web_contents_ = nullptr;
}
// static
gin::Handle<BrowserView> BrowserView::New(gin_helper::ErrorThrower thrower,
gin::Arguments* args) {