From: James Turner Date: Sat, 16 Nov 2013 14:25:12 +0000 (+0000) Subject: Globals: delete/shutdown tweaks. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2c4ac0889586cbfc930abbc0fe925c89038eeda9;p=flightgear.git Globals: delete/shutdown tweaks. Avoid aircraft-model crash in accessing fx/sound during shutdown. --- diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index c53656d17..163e26180 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -191,15 +191,15 @@ FGGlobals::~FGGlobals() ai->unbind(); subsystem_mgr->remove("ai-model"); } - - subsystem_mgr->remove("fx"); - subsystem_mgr->remove("sound"); + + subsystem_mgr->remove("aircraft-model"); subsystem_mgr->remove("tile-manager"); subsystem_mgr->remove("model-manager"); subsystem_mgr->shutdown(); subsystem_mgr->unbind(); delete subsystem_mgr; + subsystem_mgr = NULL; // important so ::get_subsystem returns NULL delete renderer; renderer = NULL; @@ -421,6 +421,10 @@ FGGlobals::get_subsystem_mgr () const SGSubsystem * FGGlobals::get_subsystem (const char * name) { + if (!subsystem_mgr) { + return NULL; + } + return subsystem_mgr->get_subsystem(name); }