[osg-users] Removing objects with shared GL state from scene graph

Chris Djali krizdjali at gmail.com
Tue Jul 2 15:21:16 PDT 2019


Hi,

This surprises me, but apparently clearing the object cache is enough to stop anything from leaking (otherwise, in the case where the second text node was removed, too, without releasing its GL objects, CodeXL was reporting two leaked shaders and three leaked program pipelines). I was expecting some things not to be released by their destructors, but apparently everything is.

I'm now in a situation where I think I can solve the issue that's bothering me sufficiently tidily that it won't be a maintanance nightmare, so the OpenMW Construction Set might be about to get its first non-nasty piece of code, which is nice.

I've seen that the object cache also has a releaseGLObjects function, which I imagine should have roughly the same effect except with the option to do it for just one context instead of all of them. I'm planning on calling that as part of a viewer cleanup operation. Might it be an idea to make this happen automatically in OSG without applications having to set it up themselves?

Cheers,
Chris

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76361#76361







More information about the osg-users mailing list