From: James Turner Date: Sun, 6 Oct 2013 16:33:09 +0000 (+0100) Subject: Reset: given FGScenery a shutdown method. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=06db85f42b85df32fe916fafa8eaad8badba1e6a;p=flightgear.git Reset: given FGScenery a shutdown method. Forces OSG branch references to be dropped. --- diff --git a/src/Scenery/scenery.cxx b/src/Scenery/scenery.cxx index d243a8ae4..47a08763e 100644 --- a/src/Scenery/scenery.cxx +++ b/src/Scenery/scenery.cxx @@ -269,6 +269,16 @@ void FGScenery::init() { sgUserDataInit( globals->get_props() ); } +void FGScenery::shutdown() +{ + sgUserDataInit( NULL ); + + scene_graph = NULL; + terrain_branch = NULL; + models_branch = NULL; + aircraft_branch = NULL; +} + void FGScenery::update(double dt) { diff --git a/src/Scenery/scenery.hxx b/src/Scenery/scenery.hxx index cfa0f935a..e6a2d7051 100644 --- a/src/Scenery/scenery.hxx +++ b/src/Scenery/scenery.hxx @@ -61,6 +61,7 @@ public: // Implementation of SGSubsystem. void init (); + void shutdown (); void bind (); void unbind (); void update (double dt);