From Cory Riddel based on suggestion from Robert Osfield, "I've been running with your suggested changes for a few days now and it

has been working perfectly. I'm still not entirely clear why adding a
slave/subgraph causes the problem."
This commit is contained in:
Robert Osfield
2009-07-13 16:39:51 +00:00
parent 9aa6d33980
commit bedd22de23

View File

@@ -18,6 +18,7 @@
#include <osgViewer/api/Win32/GraphicsWindowWin32>
#include <osgViewer/api/Win32/PixelBufferWin32>
#include <osgViewer/View>
#include <osg/DeleteHandler>
#include <osg/ApplicationUsage>
@@ -1270,6 +1271,21 @@ void GraphicsWindowWin32::destroyWindow( bool deleteNativeWindow )
{
if (_destroying) return;
_destroying = true;
if (_graphicsThread && _graphicsThread->isRunning())
{
// find all the viewers that might own use this graphics context
osg::GraphicsContext::Cameras cameras = getCameras();
for(osg::GraphicsContext::Cameras::iterator it=cameras.begin(); it!=cameras.end(); ++it)
{
osgViewer::View* view = dynamic_cast<osgViewer::View*>((*it)->getView());
osgViewer::ViewerBase* viewerBase = view ? view->getViewerBase() : 0;
if (viewerBase && viewerBase->areThreadsRunning())
{
viewerBase->stopThreading();
}
}
}
if (_hdc)
{