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: Notification crash in destructor on app quit #21709
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.
Seems a bit fishy to me that setting the delegate to nullptr on an object that is then immediately destroyed would change behavior. Is the notification being used after having been freed..?
@nornagon see #19842 (comment) for more context :) |
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.
ah, I missed that notification_
here is a WeakPtr
and not a unique_ptr
.
Release Notes Persisted
|
I have automatically backported this PR to "6-1-x", please check out #21718 |
I have automatically backported this PR to "7-1-x", please check out #21719 |
I have automatically backported this PR to "8-x-y", please check out #21720 |
Description of Change
Closes #19842.
Closes #18701.
Previously, when you close the api notification, that notification forgets about the platform notification. As such, when it is destroyed it will not call
set_delegate(nullptr)
. The notification can be reset here without the delegate having been reset, which creates the conditions necessary for this crash. This PR fixes that by ensuring that the delegate is always set tonullptr
before the notification is reset.cc @MarshallOfSound @nornagon
h/t to @charlag for great work investigating this!
Checklist
npm test
passesRelease Notes
Notes: Fixed a crash that would occur when Notifications were closed in concert with app termination.