From d833a5be9279f5f4eaf3a078fe338c2d8249ea5b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 10 Jun 2016 17:01:42 +0100 Subject: [PATCH] Fixed memory leak --- src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp b/src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp index f556282a5..d162db8a9 100644 --- a/src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp +++ b/src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp @@ -10,7 +10,7 @@ static bool checkInfluenceMap( const osgAnimation::RigGeometry& geom ) static bool readInfluenceMap( osgDB::InputStream& is, osgAnimation::RigGeometry& geom ) { - osgAnimation::VertexInfluenceMap* map = new osgAnimation::VertexInfluenceMap; + osg::ref_ptr map = new osgAnimation::VertexInfluenceMap; unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET; for ( unsigned int i=0; i> is.END_BRACKET; - if ( !map->empty() ) geom.setInfluenceMap( map ); + if ( !map->empty() ) geom.setInfluenceMap( map.get() ); return true; } @@ -51,7 +51,7 @@ static bool writeInfluenceMap( osgDB::OutputStream& os, const osgAnimation::RigG if ( name.empty() ) name = "Empty"; os << os.PROPERTY("VertexInfluence"); - os.writeWrappedString(name); + os.writeWrappedString(name); os.writeSize(vi.size()) ; os << os.BEGIN_BRACKET << std::endl; for ( osgAnimation::VertexInfluence::const_iterator vitr=vi.begin();