Added automatic setting of thread safe reference counting when multi-threaded

cameras are used.
This commit is contained in:
Robert Osfield
2005-11-24 10:14:05 +00:00
parent e1dd759dd8
commit 83f43b37e6

View File

@@ -231,6 +231,11 @@ void OsgCameraGroup::_init()
else if (strcmp(str,"OFF")==0) Producer::RenderSurface::shareAllGLContexts(false);
}
if (_thread_model==ThreadPerCamera && _cfg->getNumberOfCameras()>1)
{
// switch on thread safe reference counting by default when running multi-threaded.
osg::Referenced::setThreadSafeReferenceCounting(true);
}
_scene_data = NULL;
_global_stateset = NULL;