From 06db85f42b85df32fe916fafa8eaad8badba1e6a Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 6 Oct 2013 17:33:09 +0100 Subject: [PATCH] Reset: given FGScenery a shutdown method. Forces OSG branch references to be dropped. --- src/Scenery/scenery.cxx | 10 ++++++++++ src/Scenery/scenery.hxx | 1 + 2 files changed, 11 insertions(+) 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); -- 2.39.5