From 8ea8b49464419af80c860740339cea33eee05712 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 21 Sep 2009 23:31:04 -0700 Subject: [PATCH] Avoid locking a NULL context when a device is disconnected --- Alc/ALu.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Alc/ALu.c b/Alc/ALu.c index 712462ca..bdd10db1 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -1381,14 +1381,13 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) ALvoid aluHandleDisconnect(ALCdevice *device) { - if(!device->IsCaptureDevice) + if(device->Context) { - ALsource *source = NULL; + ALsource *source; SuspendContext(device->Context); - if(device->Context) - source = device->Context->Source; + source = device->Context->Source; while(source) { if(source->state == AL_PLAYING) -- 2.11.4.GIT