On 15/12/08 6:45 PM, Andreas Goebel wrote:
TheGeometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,0,numCoords)); ... I ask myself if this will give a memory-leak, or if this is ok, as the pointer is directly passed to the TheGeometry-object (which lives in a ref_ptr).
Exactly. Because it's passed to a ref_ptr it won't leak. You could also assign it to a local non-ref_ptr and it still would be OK.
The more likely error case is stale objects (holding a non-smart pointer to a deleted object), not memory leaks because the object is held (and eventually deleted) in a ref_ptr inside OSG.
Cheers, /ulrich _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org