fix(crash): replace exit(1) in ShutdownHandler with SDL_QUIT event#1114
Open
bassdr wants to merge 2 commits into
Open
fix(crash): replace exit(1) in ShutdownHandler with SDL_QUIT event#1114bassdr wants to merge 2 commits into
bassdr wants to merge 2 commits into
Conversation
serprex
approved these changes
Jun 2, 2026
Closed
Calling exit() from a signal handler is not async-signal-safe: it triggers C++ destructors and atexit handlers which try to acquire mutexes already held by audio threads, causing a deadlock that the OS aborts as a crash. Push SDL_QUIT instead so the main event loop shuts down cleanly via the existing Close() path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The crash is caused by acquiring content of the shared_ptr after it was released. Added two shared_ptrs, one for ImGuiWMInit/Shudtown and the other for ImGuiBackendInit/Shutdown. this way we are sure it's not used anymore by anyone.
d6da9fa to
1a309ed
Compare
Author
|
I just rebased on latest main to see if the CICD failures on MAC/IOS was caused by this. I can't explain how this could break them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Calling exit() from a signal handler is not async-signal-safe: it triggers C++ destructors and atexit handlers which try to acquire mutexes already held by audio threads, causing a deadlock that the OS aborts as a crash. Push SDL_QUIT instead so the main event loop shuts down cleanly via the existing Close() path.