Hi Sylvain, It sounds like the OpenGL object caches aren't being cleared when the graphics context deletes (the OSG has to use these caches as you can't delete OpenGL from any thread that can delete a scene graph object.) There is lots of support within the OSG to try and catch this properly, but there may be usage combinations that break this. I really don't know enough about the specifics of your implementation to know what might be amiss. You don't say which version of the OSG you are using, older versions din't catch all the usage cases of closing context, so I would suggest you are use a recent version of the OSG to make sure you have the best chance of all the loop holes with context/viewer destruction being closed.
Failing that then calling the osg::discardAllGLObjects(contextID) is a brute force way of clearing all the caches. Robert. On 10 January 2014 13:48, Sylvain Comtois <[email protected]> wrote: > Hi, > > We have a pretty complex software, under windows, that have a window the > user can close and open for 3D rendering with OSG. > > When the user close the window we delete all OSG object except some node > create from .osg or .ive files to speed up the next load process. > > The first time the user open the window we create the viewer and we load > the nodes and everything just work perfectly. When the user close the window, > everything is delete and we keep some nodes in a table. > > The next time the user open the window we recreate the viewer and we > create new node and use again node store in the table. In this second or > subsequent creation of the window we have some or all of the nodes, stock in > the table, that are not display correctly. The nodes newly create are always > corrects. > > By example, if we have a table with four objects (car, plane, box and > ball) the ball can be show in place of the car or sometime just nothing is > showed. > > We believe we using the correct geode because of the followings test: > First we save the geode in osg file for the first time we open the window > when the geode is correct and in the next time the geode is not correct. We > compare the two files and the only difference are UniqueID MatricTransform_0 > and UniqueID StateSet_0. > > Second we draw a bounding box around the object and the bounding correspond > to the object we expected to be show. We use the ComputeBoundVistor to find > the dimensions of the object. > > The software is also use in a realty center (cave) when in this > configuration we use 4 cameras when each camera represent a wall of the cave. > We have one master camera with three slaves cameras sharing the same scene > data and the same viewer. > > In this configuration we can also observe the problem but in a different > manner. Some camera show the right geode and some show a wrong geode. We only > have to move the geode from one camera to another to see the two > representation of the geode. Like in one camera mode, the problem is never > present the first time we open the windows. > > To clear the osg environment, we only set all reference pointer we use to > 0 (viewer, scenegraph, cameras, etc). We also verify in the debug log that > the destructor of the viewer is called. > > But according to the log, it seem the 'GraphicContext' is not completely > close. > > Do we have to do something else to perfectly clean all the OSG > environment. Does OSG use internal cache table that we need to reset ? > > Thank you! > > Cheers, > Sylvain > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=57854#57854 > > > > > > _______________________________________________ > 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

