[osg-submissions] osgViewer::View Memory Leak
Robert Osfield
robert.osfield at gmail.com
Sat Dec 8 06:34:21 PST 2007
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 <osgcipp at gmail.com> 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
> osg-submissions at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
More information about the osg-submissions
mailing list