Hi Ufuk,

thank you for your attention.. :)
actually i didn't know that it is deleted on "suitable time". i always expected it to be deleted when i set to NULL.

Perhaps it's as simple as: the render back-end had a ref_ptr to your geometry because it was busy rendering it. So when you set your pointer to NULL, the ref count went down to 1, and at the end of rendering the current frame the render back-end released all its ref_ptrs and your geometry was deleted.

Also, search the archives, I have posted a while back a modification to osg::Referenced that allowed you to have certain functions called each time a ref_ptr increments or decrements its reference count, along with Win32 functions that captured the call stack at that point. I had developed it as a way of tracking a memory leak that was caused by circular ref_ptrs. The modifications in question were not general enough to be integrated (in particular they had no Linux/MacOS X implementation), but they were certainly useful for me, and it could be instructive to you if you want to know exactly who has each reference to your object.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to