diff options
author | Chris Robinson <[email protected]> | 2011-09-11 20:51:30 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-09-11 20:51:30 -0700 |
commit | 0dc5837b827813a2c48b5a099e62da65c0e5876e (patch) | |
tree | 1446769a0161987d4633cd56e6a681ae852c50bb /OpenAL32/alAuxEffectSlot.c | |
parent | b4cbb3380a750761aa0a80ab6a326bc99134109d (diff) |
Fix a possible race condition when setting an effect on a slot
Diffstat (limited to 'OpenAL32/alAuxEffectSlot.c')
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 4 |
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 |