diff options
author | Chris Robinson <[email protected]> | 2008-01-14 10:54:33 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2008-01-14 10:54:33 -0800 |
commit | 7a4870bd97aa568ca35d405442b1a27b58f844e5 (patch) | |
tree | 8c2892afb56b2324c36920152d73d9bc9fb24fdf /Alc/ALc.c | |
parent | a552e32a9aa878c342582b2b10eecb29eaa00582 (diff) |
Close dangling devices when exiting
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 22 |
1 files changed, 22 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); + } +} + /////////////////////////////////////////////////////// |