aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c10
1 files changed, 8 insertions, 2 deletions
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);