diff --git a/apps/openmw/mwsound/openal_output.cpp b/apps/openmw/mwsound/openal_output.cpp index 773f877ef3..363a0d06b5 100644 --- a/apps/openmw/mwsound/openal_output.cpp +++ b/apps/openmw/mwsound/openal_output.cpp @@ -710,8 +710,8 @@ namespace MWSound bool OpenAL_Output::init(const std::string& devname, const std::string& hrtfname, HrtfMode hrtfmode) { - const std::lock_guard lock(mReopenMutex); deinit(); + std::lock_guard lock(mReopenMutex); Log(Debug::Info) << "Initializing OpenAL..."; @@ -979,7 +979,7 @@ namespace MWSound void OpenAL_Output::deinit() { mStreamThread->removeAll(); - mDefaultDeviceThread.release(); + mDefaultDeviceThread.reset(); for (ALuint source : mFreeSources) alDeleteSources(1, &source); @@ -1660,7 +1660,6 @@ namespace MWSound OpenAL_Output::~OpenAL_Output() { - const std::lock_guard lock(mReopenMutex); OpenAL_Output::deinit(); }