Hi Chris,
On Wed, Sep 4, 2013 at 5:47 PM, Roland Hill
<[email protected]> 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_ptr<osg::Camera>, which then increments the reference count.
Therefore the reference count is decremented to 1 (not 0) at the end of the
block.
Roland,
Thank you. I did not expect that behavior, although I knew I was
wrong about something. There must be some interesting plumbing that
allows an osg::ref_ptr being constructed from a raw pointer inside
osg::viewer to recognize that there is another osg::ref_ptr inside
main() that holds the same raw pointer. I do not see any mechanism
for this in the ref_ptr header. :-/
This doesn't require any magic. The pointer is not a shared but an
intrusive pointer.
So reference count is inside the Referenced object not in the pointer.
cheers
Sebastian
Thanks again,
Chris
_______________________________________________
osg-users mailing list
[email protected]
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