From: frohlich Date: Wed, 3 Jun 2009 19:30:35 +0000 (+0000) Subject: Invent a property root if not given in the options struct. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9d0bad29c043899d585cad7e3ceb47a1667dc08f;p=simgear.git Invent a property root if not given in the options struct. Modified Files: simgear/scene/model/SGReaderWriterXML.cxx --- diff --git a/simgear/scene/model/SGReaderWriterXML.cxx b/simgear/scene/model/SGReaderWriterXML.cxx index 0f4cdb95..20dc337d 100644 --- a/simgear/scene/model/SGReaderWriterXML.cxx +++ b/simgear/scene/model/SGReaderWriterXML.cxx @@ -79,7 +79,7 @@ SGReaderWriterXML::readNode(const std::string& fileName, = dynamic_cast(options); string fg_root; - SGPropertyNode *prop_root=0; + SGSharedPtr 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();