]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/globals.cxx
Reset, fix Nasal timers added on shutdown.
[flightgear.git] / src / Main / globals.cxx
index f1f8bd1e592f668e89e1234bcc42224fa31e4e0b..3f469d05a2df3476a6888345bd555287750fd258 100644 (file)
@@ -544,6 +544,18 @@ static void treeDumpRefCounts(int depth, SGPropertyNode* nd)
     }
 }
 
+static void treeClearAliases(SGPropertyNode* nd)
+{
+    if (nd->isAlias()) {
+        nd->unalias();
+    }
+    
+    for (int i=0; i<nd->nChildren(); ++i) {
+        SGPropertyNode* cp = nd->getChild(i);
+        treeClearAliases(cp);
+    }
+}
+
 void
 FGGlobals::resetPropertyRoot()
 {
@@ -564,6 +576,9 @@ FGGlobals::resetPropertyRoot()
     orientHeading.clear();
     orientRoll.clear();
     
+    // clear aliases so ref-counts are accurate when dumped
+    treeClearAliases(props);
+    
     SG_LOG(SG_GENERAL, SG_INFO, "root props refcount:" << props.getNumRefs());
     treeDumpRefCounts(0, props);