mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-08-29 09:30:14 -04:00
Exit cleanly after teardown instead of racing static destructors (#718)
Normal quits ran the full static-destructor chain, where destruction order is unspecified and something logs through spdlog after its statics are destroyed, intermittently segfaulting on exit (same class as upstream issue #689). All user-visible state (config, saves) is already persisted by GameEngine::Destroy, so end the process with _Exit like the extraction error paths already do. Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
+5
-1
@@ -1070,5 +1070,9 @@ extern "C"
|
||||
CustomEngineDestroy();
|
||||
// GameEngine::Instance->ProcessFrame(push_frame);
|
||||
GameEngine::Instance->Destroy();
|
||||
return 0;
|
||||
// Everything user-visible (config, saves) is persisted by Destroy(). Skip the
|
||||
// remaining static destructors: their order is unspecified and some log after
|
||||
// spdlog's own statics are gone, crashing on quit (same class as issue #689).
|
||||
// Mirrors the _Exit precedent on the extraction error paths.
|
||||
_Exit(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user