HI Robert, I have just begun looking at the changes and don't quite understand all the bits and pieces but in feel that the general approach is sound, once I fully understand the changes I'll know whether it's in a form that is ideal for merging.
One thing I don't understand yet is why you call reset() then set the _state pointer to null. Is it that there is another reference to the State object that _state points to prevent the _state = 0 from deleting the object? Robert. On 18 October 2013 16:41, Robert Milharcic <[email protected]>wrote: > Hi Robert, > > I've encountered this bug a few times now. It happens only when I often > create and destroy graphics contexts, for example, when I use > CompositeViewer add/remove view or add/remove instances of a Viewer etc. > The bug doesn't show often but when it does, I end up with empty window > and a lot of GL errors and warnings. This bug will manifest itself when the > following objects are used: DisplayList, VBO, Vertex/Fragment Program, > QueryObject, Shader, Program and maybe others that also have "deleted > cache". > > I tracked the problem down to GraphicsContext::close() where I found that > GraphicsContext's _state is destroyed too late and so its (directly or > indirectly) referenced GLObjects can't make it into individual GLObject's > deleted cache in time. As a consequence osg::deleteAllGLObjects misses them > and the objects are left to be potentionaly deleted afterwards in a new but > obviously wrong GraphicsContext that happens to have the same contextID as > deleted one (see SceneView::draw() and _requiresFlush flag). > > I don't know if attached fix is the best way to tackle the problem... but > anyway, here it is... against the latest trunk. > > Best Regards > Robert Milharcic > > > _______________________________________________ > osg-submissions mailing list > [email protected] > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > >
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
