fix(client): drain flying objects before effect shutdown

This commit is contained in:
shen
2026-10-16 23:12:13 -07:00
parent 569afb1378
commit b9f5d737cb
4 changed files with 22 additions and 1 deletions
+9
View File
@@ -1244,6 +1244,15 @@ void Stop()
mt::meshport::shutdown(); // PORT: join SDK worker and stop mesh before Python/platform teardown.
#endif
g_launcher->Clear();
// CPythonApplication::Destroy clears flying objects before characters and
// effects. A live missile's ClearAttachInstance still calls CEffectManager;
// leaving it for g_flying_manager's destructor used a destroyed singleton.
if (g_flying_manager)
g_flying_manager->Destroy();
// GameSingletons members are destroyed in reverse declaration order. Drain
// characters while pyTextTail, pyItem and pyBackground are still alive.
if (g_game_singletons)
g_game_singletons->kChrMgr.Destroy();
g_game_singletons.reset();
g_game_application.reset();
g_effect_manager.reset();