From 30e01a7dba78826ab4b0099a313c6f8a46656e42 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 3 Sep 2014 16:02:00 -0700 Subject: [PATCH] Protect alProcessUpdatesSOFT with a lock --- OpenAL32/alState.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index b001d3f4..b4f17b9d 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -769,11 +769,11 @@ AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void) context = GetContextRef(); if(!context) return; + LockContext(context); if(ExchangeInt(&context->DeferUpdates, AL_FALSE)) { ALsizei pos; - LockContext(context); LockUIntMapRead(&context->SourceMap); for(pos = 0;pos < context->SourceMap.size;pos++) { @@ -793,8 +793,8 @@ AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void) SetSourceState(Source, context, new_state); } UnlockUIntMapRead(&context->SourceMap); - UnlockContext(context); } + UnlockContext(context); ALCcontext_DecRef(context); }