-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Make fire_and_forget exception safe #17783
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.
I love this. Thanks!
winrt::fire_and_forget TermControl::UpdateControlSettings(IControlSettings settings) | ||
void TermControl::UpdateControlSettings(IControlSettings settings) | ||
{ | ||
return UpdateControlSettings(settings, _core.UnfocusedAppearance()); | ||
UpdateControlSettings(settings, _core.UnfocusedAppearance()); |
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 really the only change in this PR that isn't winrt::fire_and_forget
--> safe_void_coroutine
. Should be fine though.
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.
/me re-names this til::fire_and_forget
i can't be the only one that enjoyed the mental imagery of "fire and forget". very clear meaning IMO
I'll be curious to see what exceptions we're just gonna ignore now and how the side-effects will end up propagating to future code that executes.
This PR clones
winrt::fire_and_forget
and replaces the uncaughtexception handler with one that logs instead of terminating.
My hope is that this removes one source of random crashes.
Validation Steps Performed
I added a
THROW_HR
toTermControl::UpdateControlSettings
before and after the suspension point and ensured the application
won't crash anymore.