Show
Ignore:
Timestamp:
06/05/09 21:05:37 (5 years ago)
Author:
robert
Message:

Added collateReferencesToDependentCameras() and clearReferencesToDependentCameras() methods into RenderStage? and SceneView?, and use
of these methods in src/osgViewer/Renderer.cpp to make sure that the draw thread keeps references to all in scene graph Cameras
that are being used by the drawing threads, to keep the Camera's alive even when the main thread removes these Cameras from the scene graph.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgViewer/Renderer.cpp

    r9552 r10316  
    385385    if (sceneView && !_done) 
    386386    { 
     387        // since we are running the draw thread in parallel with the main thread it's possible to unreference Camera's 
     388        // that are still being used by this rendering thread, so to prevent this we'll take references to all these 
     389        // Camera's and the clear these references once we've completed the whole draw dispatch. 
     390        sceneView->collateReferencesToDependentCameras(); 
     391 
    387392        if (_compileOnNextDraw) 
    388393        { 
     
    486491        } 
    487492 
     493        sceneView->clearReferencesToDependentCameras(); 
    488494    } 
    489495