diff --git a/src/osgPlugins/quicktime/QuicktimeImageStream.cpp b/src/osgPlugins/quicktime/QuicktimeImageStream.cpp index 429923ce6..1aab32b60 100644 --- a/src/osgPlugins/quicktime/QuicktimeImageStream.cpp +++ b/src/osgPlugins/quicktime/QuicktimeImageStream.cpp @@ -36,7 +36,7 @@ using namespace osg; #define IDLE_TIMEOUT 150000L #define ERR_MSG(no,msg) osg::notify(osg::WARN) << "QT-ImageStream: " << msg << " failed with error " << no << std::endl; -static OpenThreads::Mutex s_qtMutex; +static OpenThreads::Mutex* s_qtMutex = new OpenThreads::Mutex; // Constructor: setup and start thread @@ -44,7 +44,7 @@ QuicktimeImageStream::QuicktimeImageStream(std::string fileName) : ImageStream() { { - OpenThreads::ScopedLock lock(s_qtMutex); + OpenThreads::ScopedLock lock(*s_qtMutex); osgQuicktime::initQuicktime(); } @@ -74,11 +74,9 @@ QuicktimeImageStream::~QuicktimeImageStream() // clean up quicktime movies. { - OpenThreads::ScopedLock lock(s_qtMutex); + OpenThreads::ScopedLock lock(*s_qtMutex); delete _data; } - - } @@ -112,7 +110,7 @@ void QuicktimeImageStream::load(std::string fileName) { osg::notify(osg::DEBUG_INFO) << "QT-ImageStream: loading quicktime movie from " << fileName << std::endl; - OpenThreads::ScopedLock lock(s_qtMutex); + OpenThreads::ScopedLock lock(*s_qtMutex); _data->load(this, fileName); @@ -123,16 +121,17 @@ void QuicktimeImageStream::load(std::string fileName) void QuicktimeImageStream::quit(bool wiatForThreadToExit) { - osg::notify(osg::DEBUG_INFO)<<"Sending quit"< lock(s_qtMutex); + OpenThreads::ScopedLock lock(*s_qtMutex); if (cmd != THREAD_IDLE) { switch (cmd) {