Skip to content

fix: ensure WebContents before checking draggable region#41154

Merged
codebytere merged 1 commit intomainfrom
fix-wvc-no-api-wb-crash
Jan 30, 2024
Merged

fix: ensure WebContents before checking draggable region#41154
codebytere merged 1 commit intomainfrom
fix-wvc-no-api-wb-crash

Conversation

@codebytere
Copy link
Member

Description of Change

Closes #41142

Fixes an issue with potential crashes while closing or interacting with a WebContentsView after its associated WebContents has been cleaned up. We first need to ensure that api_web_contents_ is not nullptr, as is done several other places in the same file.

Checklist

Release Notes

Notes: Fixed a potential crash while closing or interacting with a WebContentsView after its associated WebContents has been cleaned up.

@codebytere codebytere added semver/patch backwards-compatible bug fixes no-backport labels Jan 29, 2024
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jan 29, 2024
Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

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

Something to consider, Crash keys are useful in production crash analysis, we can confirm if it was use-after-free before making the fix.

SCOPED_CRASH_KEY_BOOL("WebContentsView_NCHT", "api_web_contents", api_web_contents_ != nullptr)

@codebytere
Copy link
Member Author

@deepak1556 in local testing I was able to confirm that api_web_contents_ is nullptr when the crash occurs - are you looking for more validation beyond that?

@deepak1556
Copy link
Member

Ah not required in that case, I was not sure if the crash was repro'd hence the earlier comment.

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jan 30, 2024
@codebytere codebytere merged commit fc91798 into main Jan 30, 2024
@codebytere codebytere deleted the fix-wvc-no-api-wb-crash branch January 30, 2024 10:53
@release-clerk
Copy link

release-clerk bot commented Jan 30, 2024

Release Notes Persisted

Fixed a potential crash while closing or interacting with a WebContentsView after its associated WebContents has been cleaned up.

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

Labels

no-backport semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Electron crashes on exit on macOS

2 participants