From bb7b18d4e10b1f1e4d76847f58e0bf778584dc9e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 16 Jan 2008 13:20:09 -0800 Subject: Keep track of references to effect slots, so they aren't deleted while in use --- OpenAL32/alAuxEffectSlot.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenAL32/alAuxEffectSlot.c') diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index 7eae3476..f39659e9 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -70,6 +70,7 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo (*list)->Gain = 1.0; (*list)->AuxSendAuto = AL_TRUE; + (*list)->refcount = 0; effectslots[i] = (ALuint)ALTHUNK_ADDENTRY(*list); (*list)->effectslot = effectslots[i]; @@ -112,6 +113,15 @@ AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, ALuint *effect alSetError(AL_INVALID_NAME); break; } + else + { + ALAuxiliaryEffectSlot = (ALeffectslot*)ALTHUNK_LOOKUPENTRY(effectslots[i]); + if(ALAuxiliaryEffectSlot->refcount > 0) + { + alSetError(AL_INVALID_NAME); + break; + } + } } if (i == n) -- cgit v1.2.3