Hi Nick,

On Thu, Feb 4, 2010 at 4:33 PM, Trajce Nikolov <[email protected]> wrote:
> hi Robert,
> just for the sake of clarification .... I dont have circular scenegraph.

Errr.... what you describe below is a circular scene graph, UserData
is still part of the scene graph, it's reference counted and still
needs to be treated like part of the scene graph.  Same applies to any
data structure in your application.

>  But
> what I do have, I put in userdata nodes from the scene graph. In
> Node::setThreadSaferefUnref() you are setting that for the userdata as well.
> And from here I get into circle, because the user data contains nodes, that
> further in the scene can point to the node that is setting the
> ThreadSafeRefUnref (complex scene, mirrors etc, so istenad of creating
> custom nodes I use UserData).

You need to remove the circular reference, the setTheadSafeRefUnref()
is also something you should be able to remove.  With thread safe
ref/unref is something you should decide on construction of your
objects, and is typically done by passing a flag into the
Referenced(bool) constructor.  Please note that scene graph objects
*should* almost always leave the thread safe ref/unref one, it's only
in very specific single threaded data structures that you can consider
the possibility of switching off thread safe ref/unref.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to