mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: crash calling BrowserWindow.removeBrowserView() with destroyed webContents (#38885)
fix: crash calling removeBrowserView() with destroyed webContents https://github.com/electron/electron/issues/37642 Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -71,6 +71,9 @@ class BrowserView : public gin::Wrappable<BrowserView>,
|
||||
// content::WebContentsObserver:
|
||||
void WebContentsDestroyed() override;
|
||||
|
||||
// ExtendedWebContentsObserver:
|
||||
void OnCloseContents() override;
|
||||
|
||||
private:
|
||||
void SetAutoResize(AutoResizeFlags flags);
|
||||
void SetBounds(const gfx::Rect& bounds);
|
||||
|
||||
Reference in New Issue
Block a user