Re: [osg-users] ref_ptr needed for this?

2008-12-15 Thread Ulrich Hertlein
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).

Re: [osg-users] ref_ptr needed for this?

2008-12-15 Thread Andreas Goebel
Ulrich Hertlein schrieb: 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

Re: [osg-users] ref_ptr needed for this?

2008-12-15 Thread Gordon Tomlinson
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Andreas Goebel Sent: Monday, December 15, 2008 8:46 AM To: OpenSceneGraph Users Subject: Re: [osg-users] ref_ptr needed for this? Ulrich Hertlein schrieb: On 15/12/08 6:45 PM, Andreas Goebel wrote: TheGeometry-addPrimitiveSet(new osg

Re: [osg-users] ref_ptr needed for this?

2008-12-15 Thread Andreas Goebel
if (TheNode.get() ){ osg::Node::ParentList parents = TheNode-getParents(); for(osg::Node::ParentList::iterator pitr=parents.begin(); pitr!=parents.end(); ++pitr) { (*pitr)-removeChild(TheNode.get()); } } And then remove the

[osg-users] ref_ptr needed for this?

2008-12-14 Thread Andreas Goebel
Hi, I have a construction like this: TheGeometry-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,0,numCoords)); which is inspired by an osg- example. I ask myself if this will give a memory-leak, or if this is ok, as the pointer is directly passed to the