aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index f0ac5847..13cca8e3 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -2272,3 +2272,23 @@ static ALint GetByteOffset(ALsource *pSource)
return lByteOffset;
}
+
+
+ALvoid ReleaseALSources(ALCcontext *Context)
+{
+#ifdef _DEBUG
+ if(Context->SourceCount > 0)
+ AL_PRINT("exit() %d Source(s) NOT deleted\n", Context->SourceCount);
+#endif
+
+ while(Context->Source)
+ {
+ ALsource *temp = Context->Source;
+ Context->Source = Context->Source->next;
+
+ // Release source structure
+ memset(temp, 0, sizeof(ALsource));
+ free(temp);
+ }
+ Context->SourceCount = 0;
+}