From: James Turner Date: Sat, 23 Oct 2010 18:09:08 +0000 (+0100) Subject: Investigating an intermittent shutdown crash; fix deletion of AIManager. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=957a59e57a7be92fd64a0c1278a6f04d0f31d327;p=flightgear.git Investigating an intermittent shutdown crash; fix deletion of AIManager. --- diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index ee5fcf2fd..33f36ecc8 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -166,8 +166,9 @@ FGGlobals::~FGGlobals() // deallocation of AIModel objects. To ensure we can safely // shut down all subsystems, make sure we take down the // AIModels system first. - subsystem_mgr->get_group(SGSubsystemMgr::GENERAL)->remove_subsystem("ai_model"); - + SGSubsystem* ai = subsystem_mgr->remove("ai_model"); + delete ai; + subsystem_mgr->unbind(); delete subsystem_mgr;