Hi All,
I have a simple and basic question about how OSG manage smart pointers and so on.

Is it true that if I declare a pointer as follows:

osg::Group* test = new osg::Group;

I would have a memory leak since I can not call a delete on "test" object pointer?

So, this is the reason why I should use a ref_ptr instead as follows?

osg::ref_ptr<osg::Group> test = new osg::Group;

In this case the smart pointer will take care of the object deletion as soon as the test variable goes out of scope.

Regards,
Gianni


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to