Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: webview crash when removing in close event#38996

Merged
codebytere merged 1 commit intomainfrom
fix-destroy-webcontents-webview
Jul 6, 2023
Merged

fix: webview crash when removing in close event#38996
codebytere merged 1 commit intomainfrom
fix-destroy-webcontents-webview

Conversation

@codebytere
Copy link
Member

Description of Change

Closes #38941.

Fixes an issue where removing a webview in a close callback could cause crashes. This happened as a result of a change made in #35509, where WebContents::CloseContents was changed to call Destroy instead of it being called in OnCloseContents by a BrowserWindow or BrowserView. This made it the case that Destroy() would also now be called for webview webContents', which could lead to crashes since that was previously handled by the embedder frame.

Checklist

Release Notes

Notes: Fixed an issue where removing a webview in a close callback could cause crashes.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/24-x-y PR should also be added to the "24-x-y" branch. target/25-x-y PR should also be added to the "25-x-y" branch. target/26-x-y PR should also be added to the "26-x-y" branch. labels Jul 5, 2023
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jul 5, 2023
@codebytere codebytere force-pushed the fix-destroy-webcontents-webview branch from d446610 to 7e920c6 Compare July 5, 2023 08:12
@codebytere codebytere force-pushed the fix-destroy-webcontents-webview branch from 7e920c6 to 00c34fe Compare July 5, 2023 08:13
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jul 6, 2023
@codebytere codebytere merged commit c7a64ab into main Jul 6, 2023
@codebytere codebytere deleted the fix-destroy-webcontents-webview branch July 6, 2023 08:20
@release-clerk
Copy link

release-clerk bot commented Jul 6, 2023

Release Notes Persisted

Fixed an issue where removing a webview in a close callback could cause crashes.

@trop
Copy link
Contributor

trop bot commented Jul 6, 2023

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

@trop trop bot added in-flight/26-x-y and removed target/26-x-y PR should also be added to the "26-x-y" branch. labels Jul 6, 2023
@trop
Copy link
Contributor

trop bot commented Jul 6, 2023

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

@trop
Copy link
Contributor

trop bot commented Jul 6, 2023

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

@trop trop bot added in-flight/25-x-y merged/26-x-y PR was merged to the "26-x-y" branch. and removed target/25-x-y PR should also be added to the "25-x-y" branch. target/24-x-y PR should also be added to the "24-x-y" branch. in-flight/26-x-y labels Jul 6, 2023
@trop trop bot added merged/24-x-y PR was merged to the "24-x-y" branch merged/25-x-y PR was merged to the "25-x-y" branch. and removed in-flight/24-x-y labels Jul 10, 2023
MrHuangJser pushed a commit to MrHuangJser/electron that referenced this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/24-x-y PR was merged to the "24-x-y" branch merged/25-x-y PR was merged to the "25-x-y" branch. merged/26-x-y PR was merged to the "26-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Crash after removing the webview that fired will-prevent-unload and called event.preventDefault().

2 participants