[osg-users] RefCount setSceneData

2007-09-28 Thread Michael Ebner
Hello,

when setting a root node to an osgViewer with setSceneData, the ref. 
count of the root node is increased by 2. A explicit call with 
setSceneData(NULL) is necessary to release the node again, simply 
setting the ref_ptr of osgViewer to NULL keeps one ref count of the root 
node.
Could someone verfiy that and perhaps fix it?

Thanks + best regards,
Michael.

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] RefCount setSceneData

2007-08-16 Thread Robert Osfield
Hi Michael,

On 8/16/07, Michael Ebner [EMAIL PROTECTED] wrote:
 when setting a root node to an osgViewer with setSceneData, the ref.
 count of the root node is increased by 2. A explicit call with
 setSceneData(NULL) is necessary to release the node again, simply
 setting the ref_ptr of osgViewer to NULL keeps one ref count of the root
 node.
 Could someone verfiy that and perhaps fix it?

I'm afraid I can't follow where the problem lies.
osgViewer::Viewer::setSceneData will use a osgViewer::Scene which will
retain a reference to the SceneGraph, and at the same time this scene
will be passed on to the Viewer's osg::Camera, so they will take
references as well, this is perfectly normal and safe.

When a Viewer destructs it should remove scene reference and
associated cameras and they will remove their references to the scene
as well, so in the end the ref count should return to zero and the
scene deleted.

Could you provide a code example that reproduces the issue that you
perceive.  Please specify which version of the OSG you are using.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org