From Michael Platings, "Changed some pointers to ref_ptr which fixed the leak

"
This commit is contained in:
Robert Osfield 2009-03-23 16:25:37 +00:00
parent 3dbda7e9bc
commit 33cdeec757
3 changed files with 6 additions and 6 deletions

View File

@ -40,7 +40,7 @@ osg::Geode* daeReader::processInstanceGeometry( domInstance_geometry *ig )
domGeometryGeodeMap::iterator iter = geometryMap.find( geom );
if ( iter != geometryMap.end() )
{
cachedGeode = iter->second;
cachedGeode = iter->second.get();
}
else
{
@ -119,7 +119,7 @@ osg::Geode* daeReader::processInstanceController( domInstance_controller *ictrl
domGeometryGeodeMap::iterator iter = geometryMap.find( geom );
if ( iter != geometryMap.end() )
{
cachedGeode = iter->second;
cachedGeode = iter->second.get();
}
else
{

View File

@ -83,7 +83,7 @@ void daeReader::processBindMaterial( domBind_material *bm, domGeometry *geom, os
if ( iter != materialMap.end() )
{
// Reuse material
ss = iter->second;
ss = iter->second.get();
}
else
{

View File

@ -232,9 +232,9 @@ protected:
domInstance_effect *currentInstance_effect;
domEffect *currentEffect;
typedef std::map< domGeometry*, osg::Geode*> domGeometryGeodeMap;
typedef std::map< domMaterial*, osg::StateSet*> domMaterialStateSetMap;
typedef std::map< std::string, osg::StateSet*> MaterialStateSetMap;
typedef std::map< domGeometry*, osg::ref_ptr<osg::Geode> > domGeometryGeodeMap;
typedef std::map< domMaterial*, osg::ref_ptr<osg::StateSet> > domMaterialStateSetMap;
typedef std::map< std::string, osg::ref_ptr<osg::StateSet> > MaterialStateSetMap;
/// Maps geometry to a Geode
domGeometryGeodeMap geometryMap;