aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-01-17 21:17:08 -0800
committerChris Robinson <[email protected]>2008-01-17 21:17:08 -0800
commit73e386dc6f3fd6fb5c801fe39a9cc3d1984c23d1 (patch)
tree1136b02f878fa8dd0ba917a95110be634271187c /OpenAL32/alSource.c
parent43cfc097de3fd84d701d7b6528cea80a28315cb7 (diff)
Release effect slots when deleting sources
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c9
1 files changed, 8 insertions, 1 deletions
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--;