From bd716b38c7fa9e2cc35356bfb9352843e6667419 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 3 Dec 2017 09:27:41 +0000 Subject: [PATCH] From Jordi Torres, added ref_ptr<> usage to quieten cppcheck false positive --- src/osgPlugins/dae/daeRSceneObjects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/dae/daeRSceneObjects.cpp b/src/osgPlugins/dae/daeRSceneObjects.cpp index 9874ed315..9096345a4 100644 --- a/src/osgPlugins/dae/daeRSceneObjects.cpp +++ b/src/osgPlugins/dae/daeRSceneObjects.cpp @@ -361,7 +361,7 @@ osg::Node* daeReader::processLight( domLight *dlight ) lightmodel->setAmbientIntensity(osg::Vec4(0.0f,0.0f,0.0f,1.0f)); _rootStateSet->setAttributeAndModes(lightmodel, osg::StateAttribute::ON); - osg::LightSource* lightsource = new osg::LightSource(); + osg::ref_ptr lightsource = new osg::LightSource(); lightsource->setLight(light); std::string name = dlight->getId() ? dlight->getId() : ""; if (dlight->getName()) @@ -520,7 +520,7 @@ osg::Node* daeReader::processLight( domLight *dlight ) light->setDirection(osg::Vec3(0, 0, -1)); } - return lightsource; + return lightsource.release(); } //