Hi Katharaina, The osgViewer tries it best to clean up the scene graph when graphics contexts get deleted, but it needs to have a handle on the scene graphs to be able to do it, removing the scene graph from the view prior to deletion of the graphics context will hide this scene graph from the viewer so full cleaning of the scene graph won't be possible. In this case you'll have to subgraph->releaseGLObjects() on the subgraphs that aren't attached prior to closing the viewer.
Later rev's osgViewer are better at handling the clean up, but don't solve the case above where the scene graph is removed prior to the viewer destruction without any clean up. You make no mention of which version of the OSG you are using, so perhaps you are seeing an older bug rather than just the above clean up issue. Either way it's best to make sure you are using OSG-2.8 as it contains a range of bug fixes/improvements. Robert. On Thu, Feb 19, 2009 at 4:02 PM, Katharina Plugge <[email protected]> wrote: > Hi, > > i'm getting some strange effects if using two osgViewer::Viewers like this: > > 1) Create viewer1 and render different parts of scene1. Destroy viewer1. > 2) Create viewer2 and render scene1. > > On some objects textures are missing or plop in and out, when moving in the > scene. If I do not destroy the first viewer, everything works fine. > > The effect is even more visible for this setup: > 1) Create viewer1 and render diffrent parts of scene1. Destroy viewer1. > 2) Create viewer2 set two groups as sceneData (group2 is child of group1). > Set scene2 as child of group2 and render. > 3) Remove scene2 from group2 and add scene1 instead. Render with viewer2. > > Here some objects are entirely invisible and textures plop in and out. > If viewer1 is not destroyed, everything works fine. > > Could there be a bug in osgViewer::Viewer concerning its destruction > (cleaning up)? > Do you have any other idea why the above mentioned effects occur? Seems like > something gets messed up with the states? > > > Greetings, > > Katharina > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=7049#7049 > > > > > > _______________________________________________ > 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

