Yes, you're right.

A good OSG coding habit is to just always assign to osg::ref_ptr.


>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.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to