aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2007-12-17 17:08:44 -0800
committerChris Robinson <[email protected]>2007-12-17 17:08:44 -0800
commit91d214d7130a5467ec7bb2860b2da3477998d12b (patch)
tree3c3911d5139c78c30adafdfd9619c39ee7bb4d89
parent635f673b95e30d4681c47792a58a2b0c6b69ea9f (diff)
Release left over filters on close
-rw-r--r--OpenAL32/Include/alFilter.h2
-rw-r--r--OpenAL32/OpenAL32.c2
-rw-r--r--OpenAL32/alFilter.c20
3 files changed, 24 insertions, 0 deletions
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h
index f46f7364..b1a61d59 100644
--- a/OpenAL32/Include/alFilter.h
+++ b/OpenAL32/Include/alFilter.h
@@ -39,6 +39,8 @@ AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piVa
AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue);
AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues);
+ALvoid ReleaseALFilters(ALvoid);
+
#ifdef __cplusplus
}
#endif
diff --git a/OpenAL32/OpenAL32.c b/OpenAL32/OpenAL32.c
index b638d945..db317800 100644
--- a/OpenAL32/OpenAL32.c
+++ b/OpenAL32/OpenAL32.c
@@ -20,6 +20,7 @@
#include "alMain.h"
#include "alBuffer.h"
+#include "alFilter.h"
#include "alThunk.h"
CRITICAL_SECTION g_mutex;
@@ -55,6 +56,7 @@ static void my_deinit()
once = AL_TRUE;
ReleaseALBuffers();
+ ReleaseALFilters();
FreeALConfig();
ALTHUNK_EXIT();
DeleteCriticalSection(&g_mutex);
diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c
index dae7dcf7..2906c703 100644
--- a/OpenAL32/alFilter.c
+++ b/OpenAL32/alFilter.c
@@ -342,6 +342,26 @@ AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pf
}
+ALvoid ReleaseALFilters(ALvoid)
+{
+#ifdef _DEBUG
+ if(g_FilterCount > 0)
+ AL_PRINT("exit() %d Filter(s) NOT deleted\n", g_FilterCount);
+#endif
+
+ while(g_FilterList)
+ {
+ ALfilter *temp = g_FilterList;
+ g_FilterList = g_FilterList->next;
+
+ // Release Buffer structure
+ memset(temp, 0, sizeof(ALfilter));
+ free(temp);
+ }
+ g_FilterCount = 0;
+}
+
+
static void InitFilterParams(ALfilter *filter, ALenum type)
{
filter->type = type;