Skip to content

fix: crash on browserView.webContents.destroy() - #31794

Merged
codebytere merged 1 commit into
mainfrom
fix-bv-destroy-crash
Nov 15, 2021
Merged

codebytere merged 1 commit into
mainfrom
fix-bv-destroy-crash

Conversation

@codebytere

@codebytere codebytere commented Nov 11, 2021 •

Copy link
Copy Markdown
Member

Description of Change

Fixes an issue where BrowserViews crashed if view.webContents.destroy() is called after loading a URL. This happened because when the webContents closed synchronously, the InspectableWebContents was forced to close before all observers had been notified, causing a CHECK here.

To fix this, I chose to remove the BrowserView type from the synchronous conditions, though if there is a preferred approach I'm happy to modify this.

Checklist

Release Notes

Notes: Fixes an issue where BrowserViews crashed if view.webContents.destroy() is called after loading a URL.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/14-x-y labels Nov 11, 2021
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Nov 11, 2021

@ckerr ckerr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change makes sense to me but I'd like a third opinion too; this feels like I might be missing some nuance.

@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Nov 12, 2021

@VerteDinde VerteDinde left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach makes sense to me 👍

@codebytere
codebytere merged commit 7e328c4 into main Nov 15, 2021
@codebytere
codebytere deleted the fix-bv-destroy-crash branch November 15, 2021 07:24
@release-clerk

release-clerk Bot commented Nov 15, 2021

Copy link
Copy Markdown

Release Notes Persisted

Fixes an issue where BrowserViews crashed if view.webContents.destroy() is called after loading a URL.

@trop

trop Bot commented Nov 15, 2021

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "14-x-y", please check out #31825

@trop

trop Bot commented Nov 15, 2021

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "15-x-y", please check out #31826

@trop

trop Bot commented Nov 15, 2021

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "16-x-y", please check out #31827

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants