Skip to content

Commit

Permalink
Added ref_ptr<> usage to avoid possible memory leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertosfield committed Jun 2, 2011
1 parent d325c2c commit 49f96b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/osgWrappers/serializers/osg/Group.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 49f96b2

Please sign in to comment.