Changeset 7622

Show
Ignore:
Timestamp:
12/08/07 16:08:32 (7 years ago)
Author:
robert
Message:

From Donald Cipperly, Fixed memory leak in computeIntersections

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgViewer/View.cpp

    r7582 r7622  
    16081608 
    16091609    osgUtil::LineSegmentIntersector::CoordinateFrame cf = camera->getViewport() ? osgUtil::Intersector::WINDOW : osgUtil::Intersector::PROJECTION; 
    1610     osgUtil::LineSegmentIntersector* picker = new osgUtil::LineSegmentIntersector(cf, local_x, local_y); 
     1610    osg::ref_ptr< osgUtil::LineSegmentIntersector > picker = new osgUtil::LineSegmentIntersector(cf, local_x, local_y); 
    16111611 
    16121612#if 0 
     
    16211621#endif 
    16221622 
    1623     osgUtil::IntersectionVisitor iv(picker); 
     1623    osgUtil::IntersectionVisitor iv(picker.get()); 
    16241624    iv.setTraversalMask(traversalMask); 
    16251625    const_cast<osg::Camera*>(camera)->accept(iv); 
     
    16641664    osg::Vec3d endVertex = osg::Vec3d(local_x,local_y,zFar) * inverse; 
    16651665     
    1666     osgUtil::LineSegmentIntersector* picker = new osgUtil::LineSegmentIntersector(osgUtil::Intersector::MODEL, startVertex, endVertex); 
    1667      
    1668     osgUtil::IntersectionVisitor iv(picker); 
     1666    osg::ref_ptr< osgUtil::LineSegmentIntersector > picker = new osgUtil::LineSegmentIntersector(osgUtil::Intersector::MODEL, startVertex, endVertex); 
     1667     
     1668    osgUtil::IntersectionVisitor iv(picker.get()); 
    16691669    iv.setTraversalMask(traversalMask); 
    16701670    nodePath.back()->accept(iv);