Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid double free when destroying WebContents #31104

Merged
merged 1 commit into from Sep 27, 2021

Conversation

zcbenz
Copy link
Member

@zcbenz zcbenz commented Sep 24, 2021

Description of Change

Fix a race condition when destroying WebContents that, if the FirstWeakCallback of gin::Wrapper has been called but the SecondWeakCallback has not, the api::WebContents::Destroy will still call delete this while unable to prevent SecondWeakCallback from calling delete this, which will result in double free.

Release Notes

Notes: Fix crash caused by double free when destroying WebContents.

@zcbenz zcbenz added semver/patch backwards-compatible bug fixes target/13-x-y labels Sep 24, 2021
@electron-cation electron-cation bot added new-pr 🌱 PR opened in the last 24 hours and removed new-pr 🌱 PR opened in the last 24 hours labels Sep 24, 2021
@codebytere codebytere merged commit 2360012 into main Sep 27, 2021
@codebytere codebytere deleted the first-weak-callback-race branch September 27, 2021 07:20
@release-clerk
Copy link

release-clerk bot commented Sep 27, 2021

Release Notes Persisted

Fix crash caused by double free when destroying WebContents.

@trop
Copy link
Contributor

trop bot commented Sep 27, 2021

I was unable to backport this PR to "13-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Sep 27, 2021

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

@trop
Copy link
Contributor

trop bot commented Sep 27, 2021

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

@trop
Copy link
Contributor

trop bot commented Sep 27, 2021

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

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.

None yet

3 participants