diff options
| author | quarrel07 <178681861+quarrel07@users.noreply.github.com> | 2026-07-23 11:23:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-23 12:23:53 -0600 |
| commit | 322cd52c167842f22d818066ef18ce7b25439075 (patch) | |
| tree | a59889552ebbf8b649a071adfb33f1cbde5e3beb | |
| parent | 78a012ce06b8756870e18230c3957c00cc2a66da (diff) | |
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>
| -rw-r--r-- | src/port/Game.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/port/Game.cpp b/src/port/Game.cpp index 1c6d49af9..9804fe324 100644 --- a/src/port/Game.cpp +++ b/src/port/Game.cpp @@ -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); } |
