<div dir="ltr"><div dir="ltr">Hi Chris,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 30 Jun 2019 at 00:52, 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">The high-level behaviour is all fine as-is. The specific problem is that it's not safe to call osgText::Text::releaseGLObjects when removing a text object as that releases GL objects for the font, too, and that can still be in use by other text nodes.<br></blockquote><div><br></div><div>It should be safe to call Text/Font::releaseGLObjects(state) with the deletion of GraphicsContext that the state associated with that GraphiscContext, that's the intention, if that isn't working and the high level functionality is working correctly then this is a bug.</div><div><br></div><div>I've just done a quick review of the code and master and 3.6 branch do mostly seem to be doing what they should in the Text/Font::releaseGLObjects().  There is one area that does look like it might be missing some releaseGLObjects() calls is in the handling of Glyph3D objects.</div><div><br></div><div>However, in your example where you were playing games with globals to prevent destruction, this remains the wrong way to implement viewers and is not supported by the relaseGLObjects() scheme, for reasons I've outlined in my replies above.<br></div><div><br></div><div>Robert.<br></div><div> </div><div><br></div><div> </div></div></div>