aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/mmdevapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/backends/mmdevapi.c')
-rw-r--r--Alc/backends/mmdevapi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c
index de4201dd..9c934095 100644
--- a/Alc/backends/mmdevapi.c
+++ b/Alc/backends/mmdevapi.c
@@ -229,7 +229,9 @@ static ALuint MMDevApiProc(ALvoid *ptr)
if(FAILED(hr))
{
ERR("CoInitialize(NULL) failed: 0x%08lx\n", hr);
+ ALCdevice_Lock(device);
aluHandleDisconnect(device);
+ ALCdevice_Unlock(device);
return 0;
}
@@ -243,7 +245,9 @@ static ALuint MMDevApiProc(ALvoid *ptr)
if(FAILED(hr))
{
ERR("Failed to get padding: 0x%08lx\n", hr);
+ ALCdevice_Lock(device);
aluHandleDisconnect(device);
+ ALCdevice_Unlock(device);
break;
}
data->Padding = written;
@@ -271,7 +275,9 @@ static ALuint MMDevApiProc(ALvoid *ptr)
if(FAILED(hr))
{
ERR("Failed to buffer data: 0x%08lx\n", hr);
+ ALCdevice_Lock(device);
aluHandleDisconnect(device);
+ ALCdevice_Unlock(device);
break;
}
}