aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alAuxEffectSlot.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-11 20:51:30 -0700
committerChris Robinson <[email protected]>2011-09-11 20:51:30 -0700
commit0dc5837b827813a2c48b5a099e62da65c0e5876e (patch)
tree1446769a0161987d4633cd56e6a681ae852c50bb /OpenAL32/alAuxEffectSlot.c
parentb4cbb3380a750761aa0a80ab6a326bc99134109d (diff)
Fix a possible race condition when setting an effect on a slot
Diffstat (limited to 'OpenAL32/alAuxEffectSlot.c')
-rw-r--r--OpenAL32/alAuxEffectSlot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index bb24f9f7..4596996b 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -523,6 +523,7 @@ static ALvoid InitializeEffect(ALCcontext *Context, ALeffectslot *EffectSlot, AL
ALeffectState *State = NULL;
ALenum err = AL_NO_ERROR;
+ LockContext(Context);
if(newtype == AL_EFFECT_NULL && EffectSlot->effect.type != AL_EFFECT_NULL)
{
State = NoneCreate();
@@ -557,13 +558,13 @@ static ALvoid InitializeEffect(ALCcontext *Context, ALeffectslot *EffectSlot, AL
if(err != AL_NO_ERROR)
{
+ UnlockContext(Context);
alSetError(Context, err);
return;
}
if(State)
{
- LockContext(Context);
if(ALEffect_DeviceUpdate(State, Context->Device) == AL_FALSE)
{
UnlockContext(Context);
@@ -589,7 +590,6 @@ static ALvoid InitializeEffect(ALCcontext *Context, ALeffectslot *EffectSlot, AL
}
else
{
- LockContext(Context);
if(!effect)
memset(&EffectSlot->effect, 0, sizeof(EffectSlot->effect));
else