The rendering backend takes a ref_ptr<> to all StateSet and Drawable
that are culled so removing these from the scene graph won't deleted
them till the draw traversal has finished with them.

The DataVariance set to DYNAMIC for Drawable and StateSet (and their
contents) that are changed in the update phase is important as the
draw traversal uses it as queue to hold the next frame back till draw
traversal has dispatched all the dynamic objects.

If Drawables and state not changing once created just leave their
DataVariance as STATIC.

Robert.
___________
Robert you gave the crucial tip! Even if I remove all relevant nodes the rendering backend may still have ref_ptrs to objects in the context of the shared library (the scene). Removing this library via dlclose() will remove this memory from the processes memory space. The next call into this memory will clearly result in a segfault. This even explains why the destructor never gets called (well it gets called by OSGs rendering backend but
a few instructions too late).

Thanks everyone!
Mathias
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to