[osg-users] using ref_ptr in any case

Sebastian Schmidt herrdersuppen at gmail.com
Mon Mar 20 06:41:35 PDT 2017


Hi.
I try to avoid possible memory leaks and currently replacing all pointers of osg object types with ref_ptr.

I read the osgproducer article and some other threads about these reference pointers, but i wonder if there is any advantage for using ref_ptr also in local scope as temporary references to existing pointers. 


Code:
osg::ref_ptr<osgViewer::View> pView = dynamic_cast<osgViewer::View*>(&aa);

[/code]

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








More information about the osg-users mailing list