diff options
-rw-r--r-- | intern/audaspace/OpenAL/AUD_OpenALDevice.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp index 33056eac923..4021df7d9c7 100644 --- a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp +++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp @@ -229,7 +229,6 @@ void AUD_OpenALDevice::updateStreams() { unlock(); m_playing = false; - m_thread = 0; pthread_exit(NULL); } @@ -296,7 +295,6 @@ AUD_OpenALDevice::AUD_OpenALDevice(AUD_Specs specs, int buffersize) m_specs = specs; m_buffersize = buffersize; m_playing = false; - m_thread = 0; m_playingSounds = new std::list<AUD_OpenALHandle*>(); AUD_NEW("list") m_pausedSounds = new std::list<AUD_OpenALHandle*>(); AUD_NEW("list") @@ -356,11 +354,15 @@ AUD_OpenALDevice::~AUD_OpenALDevice() } alcProcessContext(m_context); - unlock(); // wait for the thread to stop - if(m_thread != 0) + if(m_playing) + { + unlock(); pthread_join(m_thread, NULL); + } + else + unlock(); delete m_playingSounds; AUD_DELETE("list") delete m_pausedSounds; AUD_DELETE("list") |