From 75213ee6f951355906bd1744a2936bb764f23e40 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 21 Nov 2018 05:35:47 -0800 Subject: Always use RAII with EffectSlotLock --- Alc/alc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Alc/alc.cpp') diff --git a/Alc/alc.cpp b/Alc/alc.cpp index fa7b9f44..28c9bc6f 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -2263,7 +2263,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) } almtx_lock(&context->PropLock); - almtx_lock(&context->EffectSlotLock); + std::unique_lock slotlock{context->EffectSlotLock}; for(auto &slot : context->EffectSlotList) { EffectState *state = slot->Effect.State; @@ -2275,7 +2275,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) else UpdateEffectSlotProps(slot.get(), context); } - almtx_unlock(&context->EffectSlotLock); + slotlock.unlock(); almtx_lock(&context->SourceLock); for(auto &sublist : context->SourceList) -- cgit v1.2.3