Futher updates to MemoryManager, fixed memory leak in osgconv.
This commit is contained in:
@@ -206,12 +206,12 @@ int main( int argc, char **argv )
|
||||
fileNames.pop_back();
|
||||
}
|
||||
|
||||
osg::Node* root = osgDB::readNodeFiles(fileNames);
|
||||
osg::ref_ptr<osg::Node> root = osgDB::readNodeFiles(fileNames);
|
||||
|
||||
if( do_convert )
|
||||
root = oc.convert( root );
|
||||
root = oc.convert( root.get() );
|
||||
|
||||
if (root)
|
||||
if (root.valid())
|
||||
{
|
||||
osgDB::writeNodeFile(*root,fileNameOut);
|
||||
osg::notify(osg::NOTICE)<<"Data written to '"<<fileNameOut<<"'."<< std::endl;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -477,7 +477,12 @@ Image* Registry::readImage(Input& fr)
|
||||
|
||||
}
|
||||
|
||||
return dynamic_cast<Image*>(readObject(_imageWrapperMap,fr));
|
||||
osg::Object* obj = readObject(_imageWrapperMap,fr);
|
||||
osg::Image* image = dynamic_cast<Image*>(obj);
|
||||
if (image) return image;
|
||||
else if (obj) obj->unref();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -498,7 +503,12 @@ Drawable* Registry::readDrawable(Input& fr)
|
||||
|
||||
}
|
||||
|
||||
return dynamic_cast<Drawable*>(readObject(_drawableWrapperMap,fr));
|
||||
osg::Object* obj = readObject(_drawableWrapperMap,fr);
|
||||
osg::Drawable* drawable = dynamic_cast<Drawable*>(obj);
|
||||
if (drawable) return drawable;
|
||||
else if (obj) obj->unref();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -539,7 +549,12 @@ Node* Registry::readNode(Input& fr)
|
||||
|
||||
}
|
||||
|
||||
return dynamic_cast<Node*>(readObject(_nodeWrapperMap,fr));
|
||||
osg::Object* obj = readObject(_nodeWrapperMap,fr);
|
||||
osg::Node* node = dynamic_cast<Node*>(obj);
|
||||
if (node) return node;
|
||||
else if (obj) obj->unref();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user