Don't remove the devices from the device list on unexpected shutdown

The close functions will remove it for us
This commit is contained in:
Chris Robinson 2008-02-08 14:44:05 -08:00
parent 081e593e2b
commit 33680accea

View File

@ -1235,8 +1235,6 @@ ALCAPI ALCboolean ALCAPIENTRY alcCloseDevice(ALCdevice *pDevice)
ALCvoid ReleaseALC(ALCvoid) ALCvoid ReleaseALC(ALCvoid)
{ {
ALCdevice *Dev;
#ifdef _DEBUG #ifdef _DEBUG
if(g_ulContextCount > 0) if(g_ulContextCount > 0)
AL_PRINT("exit() %u device(s) and %u context(s) NOT deleted\n", g_ulDeviceCount, g_ulContextCount); AL_PRINT("exit() %u device(s) and %u context(s) NOT deleted\n", g_ulDeviceCount, g_ulContextCount);
@ -1244,12 +1242,10 @@ ALCvoid ReleaseALC(ALCvoid)
while(g_pDeviceList) while(g_pDeviceList)
{ {
Dev = g_pDeviceList; if(g_pDeviceList->IsCaptureDevice)
g_pDeviceList = g_pDeviceList->next; alcCaptureCloseDevice(g_pDeviceList);
if(Dev->IsCaptureDevice)
alcCaptureCloseDevice(Dev);
else else
alcCloseDevice(Dev); alcCloseDevice(g_pDeviceList);
} }
} }