First post in this forum. While trying to understand the viewer, I was going 
thru the OSG source code and saw that when a master camera is assigned to the 
viewer thru setCamera, OSG does not actually destroy the existing default 
master camera.
See...

Code:
void View::setCamera(osg::Camera* camera)
{
    if (_camera.valid()) _camera->setView(0);
    
    _camera = camera;

    if (_camera.valid())
    {
        _camera->setView(this);
        _camera->setRenderer(createRenderer(camera));
    }
}



Why is it like this? Won't this result in a memory leak when I do: 
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
osgViewer::Viewer viewer;
viewer.setCamera( camera.get() );

Thank you!

Cheers,
Nav

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=47711#47711





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

Reply via email to