Re: [osg-users] osg::ref_ptr: Why isn't it deleting my camera?

2013-09-06 Thread Alexandre Vaillancourt
2013/9/5 Roland Hill roland.h...@fourwindstechnology.com.au Yes. To use osg::ref_ptr the object has to be derived from osg::Object. That's where the reference count code is. Roland It has to be derived from osg::Referenced. ___ osg-users

Re: [osg-users] osg::ref_ptr: Why isn't it deleting my camera?

2013-09-05 Thread Chris Stankevitz
On Wed, Sep 4, 2013 at 5:47 PM, Roland Hill roland.h...@fourwindstechnology.com.au wrote: In point 7, while you pass a raw Camera* to viewer.addSlave, you will probably find that it then stores that pointer in a osg::ref_ptrosg::Camera, which then increments the reference count. Therefore the

Re: [osg-users] osg::ref_ptr: Why isn't it deleting my camera?

2013-09-05 Thread Chris Stankevitz
On Thu, Sep 5, 2013 at 6:26 AM, Chris Stankevitz chrisstankev...@gmail.com wrote: Thank you. I did not expect that behavior, although I knew I was wrong about something. There must be some interesting plumbing that allows I see now. osg::ref_ptr is more like an intrusive_ptr than a

Re: [osg-users] osg::ref_ptr: Why isn't it deleting my camera?

2013-09-05 Thread Sebastian Messerschmidt
Hi Chris, On Wed, Sep 4, 2013 at 5:47 PM, Roland Hill roland.h...@fourwindstechnology.com.au wrote: In point 7, while you pass a raw Camera* to viewer.addSlave, you will probably find that it then stores that pointer in a osg::ref_ptrosg::Camera, which then increments the reference count.

Re: [osg-users] osg::ref_ptr: Why isn't it deleting my camera?

2013-09-05 Thread Roland Hill
Chris, Yes. To use osg::ref_ptr the object has to be derived from osg::Object. That's where the reference count code is. Roland -- ROLAND HILL Director Four Winds

[osg-users] osg::ref_ptr: Why isn't it deleting my camera?

2013-09-04 Thread Chris Stankevitz
Hello, Can you please correct any wrong statements: 1. osg::ref_ptr increments the reference count when it is constructed with a pointer. 2. osg::ref_ptr decrements the reference count when it is destroyed 3. osg::ref_ptr::get returns a raw pointer and does not increase the reference count 4.

Re: [osg-users] osg::ref_ptr: Why isn't it deleting my camera?

2013-09-04 Thread Roland Hill
Hi Chris, In point 7, while you pass a raw Camera* to viewer.addSlave, you will probably find that it then stores that pointer in a osg::ref_ptrosg::Camera, which then increments the reference count. Therefore the reference count is decremented to 1