<div dir="ltr"><div dir="ltr">Hi Chris,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 25 Jul 2019 at 17:33, Chris Djali <<a href="mailto:krizdjali@gmail.com">krizdjali@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Annoyingly, while that branch fixes the issue in my examples, it isn't fixing it in my actual application. </blockquote><div><br></div><div>I guess that's an improvement :-)</div><div><br></div><div>This change is in the OpenSceneGraph-3.6 branch and the 3.6.4-rc9 so will part of the release.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The cache gets cleared when the application exits (potentially after all OpenGL contexts have been closed), but not when views are added to and removed from the composite viewer, so I'm still getting the same Warning: detected OpenGL error 'invalid value' at after RenderBin::draw(..) message. I'm not seeing Renderer::releaseGLObjects get called ever, but I can't tell whether it would be called if there was a view active when the application was closed, as I'm also battling a Qt bug that causes a crash in that situation.<br></blockquote><div><br></div><div>Are the Camera's being removed from the Window before it gets closed? I have just checked the GraphicsContext::close() method and it calls all the Camera::releaseGLObjects(), which in turn will call the Renderer::releaseGLObjects(), which will now call the ObjectCache::releaseGLObjects(). After calling all the releaseGLObjects() the GraphicsContext::close() then calls the osg::deleteAllGLObjects(_state->getContextID()) of the context isn't shared.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
There might be something weird that needs fixing at my end. I can see with tracepoints that a pair of Renderers gets constructed when the application constructs a View and StatsHandler and they get destroyed when the last ref_ptr to the view is destroyed, so the Renderers aren't sticking around forever.<br></blockquote><div><br></div><div>I don't have your application or test app with similar behavior so can't add much more.</div><div><br></div><div>With the Qt error, it could be that the OSG integration or the OSG itself isn't doing something perfectly for this usage case so the problem pops in Qt, it could also be just a Qt bug...<br></div><div><br></div><div>Robert<br></div><div> </div></div></div>