diff --git a/src/osg/OperationThread.cpp b/src/osg/OperationThread.cpp index 556c8346c..43f252a1b 100644 --- a/src/osg/OperationThread.cpp +++ b/src/osg/OperationThread.cpp @@ -340,6 +340,30 @@ int OperationThread::cancel() } // then wait for the the thread to stop running. + while(isRunning()) + { + +#if 1 + { + OpenThreads::ScopedLock lock(_threadMutex); + + if (_operationQueue.valid()) + { + _operationQueue->releaseOperationsBlock(); + // _operationQueue->releaseAllOperations(); + } + + if (_currentOperation.valid()) _currentOperation->release(); + } +#endif + // commenting out debug info as it was cashing crash on exit, presumable + // due to OSG_NOTIFY or std::cout destructing earlier than this destructor. + OSG_DEBUG<<" Waiting for OperationThread to cancel "<