aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-19 02:58:21 -0700
committerChris Robinson <[email protected]>2011-08-19 02:58:21 -0700
commitb3645df56fa96371c1818f950f380935d8095800 (patch)
tree7bdb3930780a0e820053cf2ac6b8d75b559add47 /Alc
parent711f0a29ecfca285296e0691fc8032cf0041c964 (diff)
Delete the mutex if the device fails to open
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 95541c8a..541da2a5 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1694,6 +1694,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
if(!DeviceFound)
{
alcSetError(NULL, ALC_INVALID_VALUE);
+ DeleteCriticalSection(&device->Mutex);
free(device);
device = NULL;
}
@@ -2784,6 +2785,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
{
// No suitable output device found
alcSetError(NULL, ALC_INVALID_VALUE);
+ DeleteCriticalSection(&device->Mutex);
free(device);
device = NULL;
}