Hi, Yes you're right, you can have more info here :
http://andesengineering.com/OSG_ProducerArticles/RefPointers/RefPointers.html <http://andesengineering.com/OSG_ProducerArticles/RefPointers/RefPointers.html> Cheers, On Fri, Jun 4, 2010 at 6:18 PM, Gianni Ambrosio < gianni.ambro...@vi-grade.com> wrote: > 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 > -- Serge Lages http://www.tharsis-software.com
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org