Changeset 9957

Show
Ignore:
Timestamp:
03/23/09 17:26:27 (5 years ago)
Author:
robert
Message:

From Michael Platings, fixed memory leak

Location:
OpenSceneGraph/branches/OpenSceneGraph-2.8/src/osgPlugins/dae
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/branches/OpenSceneGraph-2.8/src/osgPlugins/dae/daeRGeometry.cpp

    r9529 r9957  
    4141    if ( iter != geometryMap.end() ) 
    4242    { 
    43         cachedGeode = iter->second; 
     43        cachedGeode = iter->second.get(); 
    4444    } 
    4545    else 
     
    120120    if ( iter != geometryMap.end() ) 
    121121    { 
    122         cachedGeode = iter->second; 
     122        cachedGeode = iter->second.get(); 
    123123    } 
    124124    else 
  • OpenSceneGraph/branches/OpenSceneGraph-2.8/src/osgPlugins/dae/daeRMaterials.cpp

    r9760 r9957  
    8484                    { 
    8585                        // Reuse material 
    86                         ss = iter->second; 
     86                        ss = iter->second.get(); 
    8787                    } 
    8888                    else 
  • OpenSceneGraph/branches/OpenSceneGraph-2.8/src/osgPlugins/dae/daeReader.h

    r9529 r9957  
    233233    domEffect *currentEffect; 
    234234 
    235     typedef std::map< domGeometry*, osg::Geode*>    domGeometryGeodeMap; 
    236     typedef std::map< domMaterial*, osg::StateSet*> domMaterialStateSetMap; 
    237     typedef std::map< std::string, osg::StateSet*>    MaterialStateSetMap; 
     235    typedef std::map< domGeometry*, osg::ref_ptr<osg::Geode> >    domGeometryGeodeMap; 
     236    typedef std::map< domMaterial*, osg::ref_ptr<osg::StateSet> > domMaterialStateSetMap; 
     237    typedef std::map< std::string, osg::ref_ptr<osg::StateSet> >    MaterialStateSetMap; 
    238238 
    239239    /// Maps geometry to a Geode