mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 02:41:35 +00:00
Merge branch 'test-crash' into 'master'
Fixed mutex causing crash in openal_output.cpp See merge request OpenMW/openmw!3016
This commit is contained in:
commit
5ae276e678
1 changed files with 2 additions and 3 deletions
|
@ -710,8 +710,8 @@ namespace MWSound
|
||||||
|
|
||||||
bool OpenAL_Output::init(const std::string& devname, const std::string& hrtfname, HrtfMode hrtfmode)
|
bool OpenAL_Output::init(const std::string& devname, const std::string& hrtfname, HrtfMode hrtfmode)
|
||||||
{
|
{
|
||||||
const std::lock_guard<std::mutex> lock(mReopenMutex);
|
|
||||||
deinit();
|
deinit();
|
||||||
|
std::lock_guard<std::mutex> lock(mReopenMutex);
|
||||||
|
|
||||||
Log(Debug::Info) << "Initializing OpenAL...";
|
Log(Debug::Info) << "Initializing OpenAL...";
|
||||||
|
|
||||||
|
@ -979,7 +979,7 @@ namespace MWSound
|
||||||
void OpenAL_Output::deinit()
|
void OpenAL_Output::deinit()
|
||||||
{
|
{
|
||||||
mStreamThread->removeAll();
|
mStreamThread->removeAll();
|
||||||
mDefaultDeviceThread.release();
|
mDefaultDeviceThread.reset();
|
||||||
|
|
||||||
for (ALuint source : mFreeSources)
|
for (ALuint source : mFreeSources)
|
||||||
alDeleteSources(1, &source);
|
alDeleteSources(1, &source);
|
||||||
|
@ -1660,7 +1660,6 @@ namespace MWSound
|
||||||
|
|
||||||
OpenAL_Output::~OpenAL_Output()
|
OpenAL_Output::~OpenAL_Output()
|
||||||
{
|
{
|
||||||
const std::lock_guard<std::mutex> lock(mReopenMutex);
|
|
||||||
OpenAL_Output::deinit();
|
OpenAL_Output::deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue