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

Chris Djali krizdjali at gmail.com
Tue Jul 23 10:15:27 PDT 2019


Hi,

Now Robert seems to be back from his break, I'm just going to mention the potential footguns I found here in case they need sorting out. I've got a reasonable solution for the issue I was having, so that doesn't really need discussing any more, but it seems sensible to me that OSG might want to avoid letting people get into such a situation in the first place.

	When a context is destroyed, the object cache can still have things in it that need releasing. It might be a good idea to automatically release things in the object cache when a context is destroyed. Even in the single-view case, it's not best practice to rely on the GPU driver to clean up everything when a context is closed, so this might be helpful for anything that loads stuff from files.

	If a composite viewer has a cleanup operation, it's only called when the composite viewer is destroyed, and not when associated contexts are destroyed. This should maybe be changed so that it happens when a view is removed, too, or maybe it should be possible to set a cleanup operation on the context objects themselves.

	The static default font doesn't get released when a context is destroyed. I don't know everything about OSG, so maybe there's a list of static OSG objects that it should be added to, or maybe having static OSG objects is just a bad idea.



Cheers,
Chris

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







More information about the osg-users mailing list