[osg-users] What is the correct method for removing update callbacks?

beelzebob999-osg at yahoo.com beelzebob999-osg at yahoo.com
Fri Sep 28 06:08:11 PDT 2007


So, how do you get rid of update callbacks that are no
longer needed?  Do you have to do a separate traversal
just to check for update callbacks that are "done"? 

--- Robert Osfield <robert.osfield at gmail.com> wrote:

> Hi beelzebob666
> 
> You cannot modify the scene graph during
> renderingTraversals(), but
> can modify it in other phases of the scene graph
> operations.
> Modifying elements on the scene graph that affect
> traversal during
> traversal is a further restriction, simply because
> doing so
> invalidates iterators of the calling methods.
> 
> Robert.
> 
> On 9/28/07, beelzebob999-osg at yahoo.com
> <beelzebob999-osg at yahoo.com> wrote:
> >
> > We ran into an interesting crash, caused by the
> fact
> > that an update callback would set the update
> callback
> > pointer of its node to NULL (causing it to be
> freed),
> > before calling traverse on the node.  It seems to
> me
> > it should be possible to do a pre-order delete
> > traversal, but this causes a crash.
> >
> > This raises kind of an interesting question... how
> do
> > you go about removing update callbacks from the
> scene?
> >  Since you can only modify a scene during the
> update
> > traversal, it seems like you are forced into
> having
> > update callbacks remove themselves, which leads to
> an
> > unpleasant case of a "this" pointer deleting
> itself.
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > osg-users at lists.openscenegraph.org
> >
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> 




More information about the osg-users mailing list