1
0
Fork 0

Reset: changes for SGSubsystem ownership.

Keep in sync with updated ownership model in subsystem groups.
This commit is contained in:
James Turner 2013-11-12 23:36:18 +00:00
parent 44246d7708
commit 4a3b8c5765
2 changed files with 8 additions and 24 deletions

View file

@ -100,31 +100,12 @@ FGEnvironmentMgr::FGEnvironmentMgr () :
FGEnvironmentMgr::~FGEnvironmentMgr ()
{
SGSubsystem * subsys;
subsys = get_subsystem( "ridgelift" );
remove_subsystem( "ridgelift" );
delete subsys;
subsys = get_subsystem( "terrainsampler" );
remove_subsystem( "terrainsampler" );
delete subsys;
subsys = get_subsystem( "precipitation" );
remove_subsystem("precipitation");
delete subsys;
subsys = get_subsystem("realwx");
remove_subsystem("realwx");
delete subsys;
subsys = get_subsystem("controller");
remove_subsystem("controller");
delete subsys;
subsys = get_subsystem("magvar");
remove_subsystem("magvar");
delete subsys;
delete fgClouds;
delete _environment;

View file

@ -185,13 +185,17 @@ FGGlobals::~FGGlobals()
// deallocation of AIModel objects. To ensure we can safely
// shut down all subsystems, make sure we take down the
// AIModels system first.
SGSubsystem* ai = subsystem_mgr->remove("ai-model");
SGSubsystem* ai = globals->get_subsystem("ai-model");
if (ai) {
ai->unbind();
delete ai;
subsystem_mgr->remove("ai-model");
}
SGSubsystem* sound = subsystem_mgr->remove("sound");
subsystem_mgr->remove("fx");
subsystem_mgr->remove("sound");
subsystem_mgr->remove("tile-manager");
subsystem_mgr->remove("model-manager");
subsystem_mgr->shutdown();
subsystem_mgr->unbind();
delete subsystem_mgr;
@ -211,7 +215,6 @@ FGGlobals::~FGGlobals()
delete fontcache;
delete channellist;
delete sound;
delete locale;
locale = NULL;