]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/globals.cxx
Reset: do general init on reset path
[flightgear.git] / src / Main / globals.cxx
index 909c83fb662157b84911850e2d10e8442968824f..2fda3045bada940993b8c0d3146202eb393aaf49 100644 (file)
@@ -215,7 +215,7 @@ FGGlobals::~FGGlobals()
     subsystem_mgr = NULL; // important so ::get_subsystem returns NULL 
 
     delete time_params;
-    delete matlib;
+    set_matlib(NULL);
     delete route_mgr;
     delete ATIS_mgr;
     delete channel_options_list;
@@ -520,10 +520,9 @@ FGGlobals::resetPropertyRoot()
 {
     delete locale;
     
-#if DEBUG_RESET
     SG_LOG(SG_GENERAL, SG_INFO, "root props refcount:" << props.getNumRefs());
     treeDumpRefCounts(0, props);
-#endif
+
     props = new SGPropertyNode;
     initProperties();
     locale = new FGLocale(props);
@@ -688,4 +687,11 @@ void FGGlobals::set_tile_mgr ( FGTileMgr *t )
     _tile_mgr = t;
 }
 
+void FGGlobals::set_matlib( SGMaterialLib *m )
+{
+    if (matlib)
+        delete matlib;
+    matlib = m;
+}
+
 // end of globals.cxx