From 6a256d399392131293a1ce413b295ddcaca4f31d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 19 Mar 2012 00:38:56 -0700 Subject: [PATCH] Make sure the OpenAL stream list is clear before shutting down --- apps/openmw/mwsound/openal_output.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/openmw/mwsound/openal_output.cpp b/apps/openmw/mwsound/openal_output.cpp index 9d0cd7d566..556c1bb644 100644 --- a/apps/openmw/mwsound/openal_output.cpp +++ b/apps/openmw/mwsound/openal_output.cpp @@ -156,6 +156,13 @@ struct StreamThread { sStreams.erase(iter); sMutex.unlock(); } + + static void removeAll() + { + sMutex.lock(); + sStreams.clear(); + sMutex.unlock(); + } }; StreamThread::StreamVec StreamThread::sStreams; boost::mutex StreamThread::sMutex; @@ -363,6 +370,8 @@ void OpenAL_Output::init(const std::string &devname) void OpenAL_Output::deinit() { + StreamThread::removeAll(); + alcMakeContextCurrent(0); if(mContext) alcDestroyContext(mContext);