From 9632bfcfd64081a99cfb0bb1da69f1fa6ca5a166 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 20 Nov 2012 13:33:20 +0000 Subject: [PATCH] View-manager: update globals automatically. Make the global view-manager pointer be controlled by the instance. --- src/Main/fg_init.cxx | 4 +--- src/Main/subsystemFactory.cxx | 4 ++++ src/Viewer/viewmgr.cxx | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 716ae9514..5330ede86 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -728,9 +728,7 @@ void fgCreateSubsystems() { globals->add_subsystem("aircraft-model", new FGAircraftModel, SGSubsystemMgr::DISPLAY); globals->add_subsystem("model-manager", new FGModelMgr, SGSubsystemMgr::DISPLAY); - FGViewMgr *viewmgr = new FGViewMgr; - globals->set_viewmgr( viewmgr ); - globals->add_subsystem("view-manager", viewmgr, SGSubsystemMgr::DISPLAY); + globals->add_subsystem("view-manager", new FGViewMgr, SGSubsystemMgr::DISPLAY); globals->add_subsystem("tile-manager", globals->get_tile_mgr(), SGSubsystemMgr::DISPLAY); diff --git a/src/Main/subsystemFactory.cxx b/src/Main/subsystemFactory.cxx index 85e71456c..c174ad5fb 100644 --- a/src/Main/subsystemFactory.cxx +++ b/src/Main/subsystemFactory.cxx @@ -61,6 +61,8 @@ #include #include #include