Hi Sylvan, The Drawables that you keep around beyond the line of the view/context are they detached from the viewer prior to it's destruction? Doing this prevents the viewer/context cleanup from knowing that it needs to clean up those Drawables so they are left with dangling GL object id's.
The mechanism that viewer uses to to kick off the clean up of the scene graph is to call node->releaseGLObjects(), this method is also available on StateSet/StateAttribute and Drawable. Normally just needs to call releaseGLObjects() on the root of the scene graph and then all nodes and leaves will have the releaseGLObjects() called on them so there is no need to call it explicitly. However, it sounds like in your particular usage model you are keeping scene graph objects around that have been used in a context but are no longer assigned to the viewer so the normal clean up doesn't work. Here you'll need to call releaseGLObjects() on these nodes/drawables/statesets that are no longer assigned to the viewer, call it prior to destructing the viewer/context. Robert. On 17 April 2014 16:33, Sylvain Comtois <sylvain.comt...@gel.ulaval.ca> wrote: > Hi, > > I finally found that the problem is related with the display list of > drawables. When the viewer is delete all display list and gl context are > destroy but the drawable are still existing and keep a reference to the > context and the display list. > > When we create the new viewer, we have new context and no displaylist. > When the drawable is add to the new rendering tree and the context and > display list reference exist in the display list (create by another drawable) > exist, he use it but the display list correspond to the display list of > another drawable. > > So we decide to recreate the drawable when the viewer is recreate. > > We also observe when we destroy the viewer, we must destroy the camera of > the viewer before destroying the viewer itself. The problem is the viewer is > destroying context before destroying cameras. When the context are destroy, > they erase the display list cache. After when cameras are destroy they > destroy the remaining scene graph tree and destroy drawable that cannot > remove the display list from the context because the context are already > erase the display list cache. > > This will not be a problem if context are really destroy. But when we > recreate the viewer, some old context are reuse with they old display list > inside them. > > I'm not 100% certain of what append inside OSG but destroying the cameras > before the viewer solve my problem. > > Thank you! > > Cheers, > Sylvain > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=59023#59023 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org