fix: crash on macOS non-programmatic close #41264
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Closes #40798
Refs microsoft/vscode#204563
Fixes a crash that started occurring sporadically with some types of macOS window close after
PartitionAlloc
was enabled upstream. It seems to be the case now thatperformClose:
can causewindow_
to be null, thus causing the call toIsVisible
to crash trying to access a deallocated instance. There's probably more effective long-term fix here but we can fix this by moving the conditional determining whether we should callNotifyWindowCloseButtonClicked()
for a closed sheet aboveperformClosure
to avoid this problem altogether.Using the
Cmd+Tab -> Cmd+Q
repro provided in #40798 I tracked this back to v28.0.0-alpha.3...v28.0.0-alpha.4 - specifically reverting #33981 fixes the issue as well so we should investigate that further as a follow up.h/t @MarshallOfSound for speculating this fix in response to what might be the same issue in Discord.
cc @deepak1556 @bpasero
Checklist
npm test
passesRelease Notes
Notes: Fixed a crash that started occurring sporadically with some types of macOS window close