]> git.mxchange.org Git - simgear.git/commitdiff
Invent a property root if not given in the options struct.
authorfrohlich <frohlich>
Wed, 3 Jun 2009 19:30:35 +0000 (19:30 +0000)
committerTim Moore <timoore@redhat.com>
Wed, 3 Jun 2009 21:43:45 +0000 (23:43 +0200)
Modified Files:
simgear/scene/model/SGReaderWriterXML.cxx

simgear/scene/model/SGReaderWriterXML.cxx

index 0f4cdb955fbfffe57750cc6ebfafdbac0590dbcc..20dc337d6543e2a8b1f4332d991da749b0168eba 100644 (file)
@@ -79,7 +79,7 @@ SGReaderWriterXML::readNode(const std::string& fileName,
     = dynamic_cast<const SGReaderWriterXMLOptions*>(options);
 
     string fg_root;
-    SGPropertyNode *prop_root=0;
+    SGSharedPtr<SGPropertyNode> prop_root;
     osg::Node *(*load_panel)(SGPropertyNode *)=0;
     SGModelData *model_data=0;
     SGPath externalTexturePath;
@@ -89,6 +89,9 @@ SGReaderWriterXML::readNode(const std::string& fileName,
         load_panel = xmlOptions->getLoadPanel();
         model_data = xmlOptions->getModelData();
     }
+    if (!prop_root) {
+        prop_root = new SGPropertyNode;
+    }
 
     fg_root=osgDB::Registry::instance()->getDataFilePathList().front();