]> git.mxchange.org Git - flightgear.git/blobdiff - src/Systems/system_mgr.cxx
Merge branch 'timoore/ptrfix'
[flightgear.git] / src / Systems / system_mgr.cxx
index 682293ef67c00504c72be5f4adc61e1ba2fdf691..4936ea63818fec9a43fe5ceaac56d9fb75ff18ed 100644 (file)
@@ -10,6 +10,7 @@
 #include <simgear/structure/exception.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/sg_inlines.h>
+#include <simgear/props/props_io.hxx>
 
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
@@ -28,7 +29,7 @@
 
 FGSystemMgr::FGSystemMgr ()
 {
-    config_props = new SGPropertyNode;
+    SGPropertyNode_ptr config_props = new SGPropertyNode;
 
     SGPropertyNode *path_n = fgGetNode("/sim/systems/path");
 
@@ -41,7 +42,7 @@ FGSystemMgr::FGSystemMgr ()
         try {
             readProperties( config.str(), config_props );
 
-            if ( build() ) {
+            if ( build(config_props) ) {
                 enabled = true;
             } else {
                 SG_LOG( SG_ALL, SG_ALERT,
@@ -52,7 +53,7 @@ FGSystemMgr::FGSystemMgr ()
                         " details.");
                 exit(-1);
             }        
-        } catch (const sg_exception& exc) {
+        } catch (const sg_exception&) {
             SG_LOG( SG_ALL, SG_ALERT, "Failed to load systems system model: "
                     << config.str() );
         }
@@ -62,14 +63,13 @@ FGSystemMgr::FGSystemMgr ()
                 "No systems model specified for this model!");
     }
 
-    delete config_props;
 }
 
 FGSystemMgr::~FGSystemMgr ()
 {
 }
 
-bool FGSystemMgr::build ()
+bool FGSystemMgr::build (SGPropertyNode* config_props)
 {
     SGPropertyNode *node;
     int i;