Hi Jan, This is not for reference counting but to not forget to delete the instance when program end.
Regards David 2013/4/26 Jan Ciger <[email protected]> > On 04/26/2013 11:18 AM, David Callu wrote: > >> oups beter like this, or with any other smart pointer >> >> MyClass & getInstance() >> { >> static osg::ref_ptr<MyClass> myClass( new MyClass() ); >> return *myClass; >> } >> >> > I wonder, why would you want a reference counting smart pointer for a > singleton? There will be only a single instance, no matter what you do, so > the smart pointer is useless. > > Regards, > > Jan > > ______________________________**_________________ > osg-users mailing list > osg-users@lists.**openscenegraph.org <[email protected]> > http://lists.openscenegraph.**org/listinfo.cgi/osg-users-** > openscenegraph.org<http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org> >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

