From 5ad6eb937b6b230edcf1b75ccf8c462ea21f649e Mon Sep 17 00:00:00 2001 From: Mathias Froehlich Date: Sun, 4 Mar 2012 08:17:10 +0100 Subject: [PATCH] Make use of SGReaderWriterOptions::copyOrCreate in SGModelLib --- simgear/scene/model/modellib.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/simgear/scene/model/modellib.cxx b/simgear/scene/model/modellib.cxx index 988afea0..af72e363 100644 --- a/simgear/scene/model/modellib.cxx +++ b/simgear/scene/model/modellib.cxx @@ -109,7 +109,8 @@ SGModelLib::loadModel(const string &path, SGModelData *data, bool load2DPanels) { - osg::ref_ptr opt = new SGReaderWriterOptions(*(osgDB::Registry::instance()->getOptions())); + osg::ref_ptr opt; + opt = SGReaderWriterOptions::copyOrCreate(osgDB::Registry::instance()->getOptions()); opt->setPropertyNode(prop_root ? prop_root: static_propRoot.get()); opt->setModelData(data); @@ -132,9 +133,8 @@ SGModelLib::loadDeferredModel(const string &path, SGPropertyNode *prop_root, proxyNode->setLoadingExternalReferenceMode(osg::ProxyNode::DEFER_LOADING_TO_DATABASE_PAGER); proxyNode->setFileName(0, path); - osg::ref_ptr opt - = new SGReaderWriterOptions(*(osgDB::Registry::instance() - ->getOptions())); + osg::ref_ptr opt; + opt = SGReaderWriterOptions::copyOrCreate(osgDB::Registry::instance()->getOptions()); opt->setPropertyNode(prop_root ? prop_root: static_propRoot.get()); opt->setModelData(data); opt->setLoadPanel(static_panelFunc); @@ -158,9 +158,8 @@ SGModelLib::loadPagedModel(const string &path, SGPropertyNode *prop_root, plod->setFileName(0, path); plod->setRange(0, 0.0, 50.0*SG_NM_TO_METER); - osg::ref_ptr opt - = new SGReaderWriterOptions(*(osgDB::Registry::instance() - ->getOptions())); + osg::ref_ptr opt; + opt = SGReaderWriterOptions::copyOrCreate(osgDB::Registry::instance()->getOptions()); opt->setPropertyNode(prop_root ? prop_root: static_propRoot.get()); opt->setModelData(data); opt->setLoadPanel(static_panelFunc); -- 2.39.5