Added ref_ptr<> usage to avoid possible memory leak.

This commit is contained in:
Robert Osfield
2011-06-02 20:38:13 +00:00
parent ecfe8dbfbb
commit 2e03f53778

View File

@@ -13,7 +13,8 @@ static bool readChildren( osgDB::InputStream& is, osg::Group& node )
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
for ( unsigned int i=0; i<size; ++i )
{
osg::Node* child = dynamic_cast<osg::Node*>( is.readObject() );
osg::ref_ptr<osg::Object> obj = is.readObject();
osg::Node* child = dynamic_cast<osg::Node*>( obj.get() );
if ( child ) node.addChild( child );
}
is >> osgDB::END_BRACKET;