From: mfranz Date: Tue, 1 May 2007 09:18:11 +0000 (+0000) Subject: since the submodel_mgr subsystem does now also hold references to AI models, X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=83418376d710e93a294c51d731703f0074feb4cd;p=flightgear.git since the submodel_mgr subsystem does now also hold references to AI models, we need to explicitly destroy that here, too, so that it has guaranteed access to the Nasal subsystem. Otherwise we get a segfault on exit. When the next subsystem needs this special treatement (radar?), we should introduce a new subsystem group (in addition to INIT and GENERAL) --- diff --git a/src/Main/util.cxx b/src/Main/util.cxx index 3eb68faa0..056b9c4ed 100644 --- a/src/Main/util.cxx +++ b/src/Main/util.cxx @@ -109,9 +109,16 @@ fgExit (int status) { // remove subsystems first, which need access to other subsystems in their // destructors (e.g. "nasal") - SGSubsystem *sub = globals->get_subsystem("ai_model"); + SGSubsystem *sub; + + sub = globals->get_subsystem("ai_model"); globals->get_subsystem_mgr()->get_group(SGSubsystemMgr::GENERAL)->remove_subsystem("ai_model"); delete sub; + + sub = globals->get_subsystem("submodel_mgr"); + globals->get_subsystem_mgr()->get_group(SGSubsystemMgr::GENERAL)->remove_subsystem("submodel_mgr"); + delete sub; + #ifdef OSG_LIBRARY_STATIC osgDB::Registry::instance( true); #endif