aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-09-21 23:31:04 -0700
committerChris Robinson <[email protected]>2009-09-21 23:31:04 -0700
commit8ea8b49464419af80c860740339cea33eee05712 (patch)
tree659aba2bbe60dee0ed6fb21d19fdb178747f39c9
parent62cef44dcbb5368d383e45ba6201e0bfbce09612 (diff)
Avoid locking a NULL context when a device is disconnected
-rw-r--r--Alc/ALu.c7
1 files 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)