Hi Paul,

Thanks for the example.

The problem in your example is your circular dependency.  Right off
the bat you've created a memory leak as this subgraph. The fact that
you then hit a circular reference in the internal patent management is
perhaps not too surprising either.

You shouldn't create ownership cycles like this in your data
structures, instead you need to break them vai the use of
osg::observer_ptr<> or C pointers.  Once you do this you'll probably
avoid all the other problems you are introducing.  If your case I'd
create a UserData object that has a observer_ptr<> to the node you
want to refer to, this way you should be able attach it anywhere in
your scene graph without issues without onwership.

Robert.

On Thu, Jan 29, 2009 at 1:23 PM, Paul Melis <[email protected]> wrote:
> Hi Robert,
>
> Robert Osfield wrote:
>>
>> I'm afraid I can't work out the failure mechanism just be reading
>> email.  Could you provide a small code example program that could be
>> compiled to show the problem you are seeing.
>>
>
> Here you go. The stripped down example might not make a lot of sense, so if
> you want I can try to explain why I'm trying to do things this way.
>
> Paul
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to