-
Notifications
You must be signed in to change notification settings - Fork 15k
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 potential modal window close segfault #22410
Conversation
4847e14
to
402bcd8
Compare
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.
Seems legit but why are we disabling some tests in this PR?
@MarshallOfSound we're not - if you look at the change we used to disable all modal tests for darwin, and my change makes it such that we disable individual tests and not the suite, since i do want the new test to run on darwin |
Release Notes Persisted
|
I was unable to backport this PR to "8-x-y" cleanly; |
I was unable to backport this PR to "7-1-x" cleanly; |
I have automatically backported this PR to "9-x-y", please check out #22445 |
@codebytere has manually backported this PR to "8-x-y", please check out #22481 |
@codebytere has manually backported this PR to "7-1-x", please check out #22540 |
Description of Change
Fixes #17558.
We were previously trying to call
close
on a sheet itself, instead of calling[NSWindow endSheet:]
on the sheet's parent. As such, the window would either freeze since the modal session wasn't ended properly, or crash. To fix this, we need to end the sheet properly by calling[sheetParent endSheet:window];
, wherewindow
is the sheet itself.However! If we just call that synchronously, we block the thread with an animation, so we instead post a task. This fix was verified with the repro provided in the issue linked above.
cc @zcbenz @nornagon @MarshallOfSound
Checklist
npm test
passesRelease Notes
Notes: Fixed an occasional segfault with modal windows being closed or destroyed.