Fixed Coverity issue.
CID 12328: Resource leak (RESOURCE_LEAK) Calling allocation function "osg::KdTree::cloneType() const". (The virtual call resolves to "osg::Object * osg::KdTree::cloneType() const".) [show details] Failing to save storage allocated by "this->_kdTreePrototype->cloneType()" leaks it.
This commit is contained in:
@@ -812,7 +812,8 @@ void KdTreeBuilder::apply(osg::Geode& geode)
|
||||
osg::KdTree* previous = dynamic_cast<osg::KdTree*>(geom->getShape());
|
||||
if (previous) continue;
|
||||
|
||||
osg::ref_ptr<osg::KdTree> kdTree = dynamic_cast<osg::KdTree*>(_kdTreePrototype->cloneType());
|
||||
osg::ref_ptr<osg::Object> obj = _kdTreePrototype->cloneType();
|
||||
osg::ref_ptr<osg::KdTree> kdTree = dynamic_cast<osg::KdTree*>(obj.get());
|
||||
|
||||
if (kdTree->build(_buildOptions, geom))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user