[osg-users] How to track down memory leaks?

Igor Spiridonov igwasm at rambler.ru
Thu Jul 12 08:15:12 PDT 2018


Hello Robert.

I have found the memory leak cause. Look like I don't understand how osg works.
I have a root node and its child node. I add UpdateCallback to the root node and inside this callback i remove child nod's drawables and add another ones. I check reference count before I remove them and it's 2 for some reason. My remove decreases it on 1 but it's not enough. Looks like viewer or something else keeps these drawables and therefore memleak happens.

I checked reference count of drawables after I add them to child's node and it's always 1 but when drawables come again to UpdateCallback it becomes 2.

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







More information about the osg-users mailing list