On Fri, Apr 26, 2013 at 11:18 AM, David Callu <[email protected]> wrote:

> oups beter like this, or with any other smart pointer
>
> MyClass & getInstance()
> {
>     static osg::ref_ptr<MyClass> myClass( new MyClass() );
>     return *myClass;
>
> }
>
>
Do not forget to make all constructors private, though, otherwise you may
get a surprise when someone tries to construct your object using new
operator or define an STL vector of them ...

Regards,

Jan
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to