Hello all,

"Modifying elements on the scene graph that affect traversal during traversal 
is a [...] restriction, simply because doing so invalidates iterators of the 
calling methods.", Robert said ( 
http://lists.openscenegraph.org/htdig.cgi/osg-users-openscenegraph.org/2007-September/002938.html
 ).

Question is: according to you, what is the best/simpliest way for a node to 
deallocate itself during traversal? Here are my ideas:
- Mark the node as to be deleted in a kind of manager that does the job when 
the frame has ended.
- Create a class derived from Group that gracefully handles the invalidation of 
iterators during traverse().
- Make a nice memory leak (joking).
- Or may Node::accept() return a boolean that says if the node "commited 
suicide" (???)

I guess ther is a much simpler way, but I can't figure out which one.
(Sorry if it has already been discussed, but I can't find answers in the 
archive).

Thanks.

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to