From 43067ed2b8d4ab9c3f46b8ee002d6c3f6480cc4f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 15 Aug 2009 09:14:08 -0700 Subject: Store the buffer list in the device --- Alc/ALc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Alc/ALc.c') diff --git a/Alc/ALc.c b/Alc/ALc.c index fbabe468..492bed92 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -216,7 +216,6 @@ BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved) if(!init_done) break; ReleaseALC(); - ReleaseALBuffers(); ReleaseALEffects(); ReleaseALFilters(); FreeALConfig(); @@ -236,7 +235,6 @@ static void my_deinit() once = AL_TRUE; ReleaseALC(); - ReleaseALBuffers(); ReleaseALEffects(); ReleaseALFilters(); FreeALConfig(); @@ -1371,6 +1369,14 @@ ALCAPI ALCboolean ALCAPIENTRY alcCloseDevice(ALCdevice *pDevice) } ALCdevice_ClosePlayback(pDevice); + if(pDevice->BufferCount > 0) + { +#ifdef _DEBUG + AL_PRINT("alcCloseDevice(): deleting %d Buffer(s)\n", pDevice->BufferCount); +#endif + ReleaseALBuffers(pDevice); + } + //Release device structure memset(pDevice, 0, sizeof(ALCdevice)); free(pDevice); -- cgit v1.2.3