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:
quarrel07
2026-07-23 11:23:53 -07:00
committed by GitHub
parent 78a012ce06
commit 322cd52c16
+5 -1
View File
@@ -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);
}