diff options
-rw-r--r-- | Alc/ALc.c | 22 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 2 | ||||
-rw-r--r-- | OpenAL32/OpenAL32.c | 2 |
3 files changed, 26 insertions, 0 deletions
@@ -1239,4 +1239,26 @@ ALCAPI ALCboolean ALCAPIENTRY alcCloseDevice(ALCdevice *pDevice) return bReturn; } + + +ALCvoid ReleaseALC(ALCvoid) +{ + ALCdevice *Dev; + +#ifdef _DEBUG + if(g_ulContextCount > 0) + AL_PRINT("exit() %u device(s) and %u context(s) NOT deleted\n", g_ulDeviceCount, g_ulContextCount); +#endif + + while(g_pDeviceList) + { + Dev = g_pDeviceList; + g_pDeviceList = g_pDeviceList->next; + if(Dev->IsCaptureDevice) + alcCaptureCloseDevice(Dev); + else + alcCloseDevice(Dev); + } +} + /////////////////////////////////////////////////////// diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index d1acfc11..bd3b00be 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -216,6 +216,8 @@ struct ALCcontext_struct ALCcontext *next; }; +ALCvoid ReleaseALC(ALCvoid); + ALCchar *AppendDeviceList(char *name); ALCchar *AppendAllDeviceList(char *name); ALCchar *AppendCaptureDeviceList(char *name); diff --git a/OpenAL32/OpenAL32.c b/OpenAL32/OpenAL32.c index fa5a9d71..a49f5b29 100644 --- a/OpenAL32/OpenAL32.c +++ b/OpenAL32/OpenAL32.c @@ -44,6 +44,7 @@ BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved) ReleaseALAuxiliaryEffectSlots(); ReleaseALEffects(); ReleaseALFilters(); + ReleaseALC(); FreeALConfig(); ALTHUNK_EXIT(); DeleteCriticalSection(&_alMutex); @@ -64,6 +65,7 @@ static void my_deinit() ReleaseALAuxiliaryEffectSlots(); ReleaseALEffects(); ReleaseALFilters(); + ReleaseALC(); FreeALConfig(); ALTHUNK_EXIT(); DeleteCriticalSection(&_alMutex); |