From 73e386dc6f3fd6fb5c801fe39a9cc3d1984c23d1 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 17 Jan 2008 21:17:08 -0800 Subject: [PATCH] Release effect slots when deleting sources --- OpenAL32/alSource.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 73b298a4..f48ef304 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -122,7 +122,7 @@ ALAPI ALvoid ALAPIENTRY alDeleteSources(ALsizei n, const ALuint *sources) ALCdevice *Device; ALsource *ALSource; ALsource **list; - ALsizei i; + ALsizei i, j; ALbufferlistitem *ALBufferList; ALboolean bSourcesValid = AL_TRUE; @@ -174,6 +174,13 @@ ALAPI ALvoid ALAPIENTRY alDeleteSources(ALsizei n, const ALuint *sources) free(ALBufferList); } + for(j = 0;j < MAX_SENDS;++j) + { + if(ALSource->Send[j].Slot) + ALSource->Send[j].Slot->refcount--; + ALSource->Send[j].Slot = NULL; + } + // Decrement Source count Context->SourceCount--; -- 2.11.4.GIT