From: James Turner Date: Tue, 20 Nov 2012 13:33:20 +0000 (+0000) Subject: View-manager: update globals automatically. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9632bfcfd64081a99cfb0bb1da69f1fa6ca5a166;p=flightgear.git View-manager: update globals automatically. Make the global view-manager pointer be controlled by the instance. --- 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