From 510ccc7f1786bffd183f5a30c7e2e3f8e8026371 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 15 Aug 2009 09:39:18 -0700 Subject: Store the effect and filter lists in the device --- Alc/ALc.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'Alc') diff --git a/Alc/ALc.c b/Alc/ALc.c index 492bed92..ece52782 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -216,8 +216,6 @@ BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved) if(!init_done) break; ReleaseALC(); - ReleaseALEffects(); - ReleaseALFilters(); FreeALConfig(); ALTHUNK_EXIT(); DeleteCriticalSection(&g_csMutex); @@ -235,8 +233,6 @@ static void my_deinit() once = AL_TRUE; ReleaseALC(); - ReleaseALEffects(); - ReleaseALFilters(); FreeALConfig(); ALTHUNK_EXIT(); DeleteCriticalSection(&g_csMutex); @@ -1376,6 +1372,20 @@ ALCAPI ALCboolean ALCAPIENTRY alcCloseDevice(ALCdevice *pDevice) #endif ReleaseALBuffers(pDevice); } + if(pDevice->EffectCount > 0) + { +#ifdef _DEBUG + AL_PRINT("alcCloseDevice(): deleting %d Effect(s)\n", pDevice->EffectCount); +#endif + ReleaseALEffects(pDevice); + } + if(pDevice->FilterCount > 0) + { +#ifdef _DEBUG + AL_PRINT("alcCloseDevice(): deleting %d Filter(s)\n", pDevice->FilterCount); +#endif + ReleaseALFilters(pDevice); + } //Release device structure memset(pDevice, 0, sizeof(ALCdevice)); -- cgit v1.2.3