Hi Donald, The case wasn't actually a memory leak unless there was an exception thrown as the IntersectionVisitor itself takes a ref_ptr<> to the intersector, and would have deleted it correctly once it went out of scope.
However, you version using the ref_ptr<> is slightly more robust in terms of not leaking in the presence of an exception being thrown in the construction of the IntersectionVisitor. So I have merged your change as an example of a "good" practice to get into. Cheers, Robert. On Oct 23, 2007 5:24 PM, Donald Cipperly <[EMAIL PROTECTED]> wrote: > In both computeIntersections methods, I believe > > osgUtil::LineSegmentIntersector *picker = new > osgUtil::LineSegmentIntersector... > > should be > > osg::ref_ptr< osgUtil::LineSegmentIntersector > picker = new > osgUtil::LineSegmentIntersector > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
