Re: [osg-users] using ref_ptr in any case

2017-03-20 Thread Sebastian Schmidt
robertosfield wrote: > Hi Sebastian, > > Using ref_ptr<> in local scope to objects t that are owned by external > scope is a good practice but isn't always required. > > If your application is multi-threaded then the external scope could > unref and objects that you are using, so if you don't ha

Re: [osg-users] using ref_ptr in any case

2017-03-20 Thread Robert Osfield
Hi Sebastian, Using ref_ptr<> in local scope to objects t that are owned by external scope is a good practice but isn't always required. If your application is multi-threaded then the external scope could unref and objects that you are using, so if you don't have your own reference to it it would

[osg-users] using ref_ptr in any case

2017-03-20 Thread Sebastian Schmidt
Hi. I try to avoid possible memory leaks and currently replacing all pointers of osg object types with ref_ptr. I read the osgproducer article and some other threads about these reference pointers, but i wonder if there is any advantage for using ref_ptr also in local scope as temporary referen