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: prevent destroyed view references from causing crashes #25411
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great start! as the crash in setBounds
is but a symptom of a larger set of potential crashes, though, we'll want to make sure we address all similar potential crashes as well as try to add regression tests for all related crashes to really close up this bug :)
Looks like lint is still failing: see https://app.circleci.com/pipelines/github/electron/electron/29870/workflows/28683667-5c33-4ba1-a255-70e8d981c345/jobs/658611 for details :) You can check these locally with |
Great! Pushing the fix now. I was actually using the notes from the errors in CI to make the fixes. I am getting local errors when running npm run lint saying "'gn' is not recognized as an internal or external command" |
Ah that's because you're exclusively on build tools I think. @codebytere we should either make @mlaurencin for now |
I tried running that and ended up with this new error |
4112399
to
5128cb0
Compare
I have automatically backported this PR to "9-x-y", please check out #25510 |
I have automatically backported this PR to "10-x-y", please check out #25511 |
…#25411) Closes electron#21666. This PR is fixing crashes caused by referencing and attempting to modify previously destroyed views. Before, when a view was destroyed and then the contents were referenced for modification, the system would crash as undefined memory was accessed. This fix explicitly makes the pointer to the destroyed view's contents null, so that this will not happen.
(cont.) references from causing crashes Referenced PR: electron#25411
@mlaurencin has manually backported this PR to "9-x-y", please check out #25609 |
Fixes: electron#40567 `null` was introduced as a possibility for destroyed webContents in this PR: electron#25411
Description of Change
Closes #21666.
Closes #21410.
This PR is fixing crashes caused by referencing and attempting to modify previously destroyed views.
Before, when a view was destroyed and then the contents were referenced for modification, the system would crash as undefined memory was accessed. This fix explicitly makes the pointer to the destroyed view's contents null, so that this will not happen.
Checklist
npm test
passesRelease Notes
Notes: Fixed crashes caused by attempting to modify destroyed views