forked from mirror/openmw-tes3mp
Make sure the OpenAL stream list is clear before shutting down
This commit is contained in:
parent
7194114669
commit
6a256d3993
1 changed files with 9 additions and 0 deletions
|
@ -156,6 +156,13 @@ struct StreamThread {
|
||||||
sStreams.erase(iter);
|
sStreams.erase(iter);
|
||||||
sMutex.unlock();
|
sMutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void removeAll()
|
||||||
|
{
|
||||||
|
sMutex.lock();
|
||||||
|
sStreams.clear();
|
||||||
|
sMutex.unlock();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
StreamThread::StreamVec StreamThread::sStreams;
|
StreamThread::StreamVec StreamThread::sStreams;
|
||||||
boost::mutex StreamThread::sMutex;
|
boost::mutex StreamThread::sMutex;
|
||||||
|
@ -363,6 +370,8 @@ void OpenAL_Output::init(const std::string &devname)
|
||||||
|
|
||||||
void OpenAL_Output::deinit()
|
void OpenAL_Output::deinit()
|
||||||
{
|
{
|
||||||
|
StreamThread::removeAll();
|
||||||
|
|
||||||
alcMakeContextCurrent(0);
|
alcMakeContextCurrent(0);
|
||||||
if(mContext)
|
if(mContext)
|
||||||
alcDestroyContext(mContext);
|
alcDestroyContext(mContext);
|
||||||
|
|
Loading…
Reference in a new issue