Fixed crash when reading a viewer configuration file where the EventVisitor was being re-assigned but left a dangling pointer

This commit is contained in:
Robert Osfield
2014-01-24 11:37:35 +00:00
parent 29ab577bc3
commit f0df819cbf

View File

@@ -266,9 +266,14 @@ void Viewer::take(osg::View& rhs)
_startRenderingBarrier = rhs_viewer->_startRenderingBarrier;
_endRenderingDispatchBarrier = rhs_viewer->_endRenderingDispatchBarrier;
_endDynamicDrawBlock = rhs_viewer->_endDynamicDrawBlock;
_eventVisitor = rhs_viewer->_eventVisitor;
_eventVisitor->setActionAdapter(this);
_eventVisitor->setFrameStamp(_frameStamp.get());
_updateOperations = rhs_viewer->_updateOperations;
_updateVisitor = rhs_viewer->_updateVisitor;
_realizeOperation = rhs_viewer->_realizeOperation;
_currentContext = rhs_viewer->_currentContext;
@@ -283,6 +288,7 @@ void Viewer::take(osg::View& rhs)
rhs_viewer->_updateVisitor = 0;
rhs_viewer->_realizeOperation = 0;
rhs_viewer->_currentContext = 0;
}
#endif
}