From b788ae52b0d966766d2cd56813a10c4936afe3f7 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 10 Sep 2011 19:19:32 -0700 Subject: Condense some code --- Alc/ALc.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'Alc') diff --git a/Alc/ALc.c b/Alc/ALc.c index f7bb134c..d149090d 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -2297,19 +2297,16 @@ ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context) ALCdevice *Device; LockLists(); + /* alcGetContextsDevice sets an error for invalid contexts */ Device = alcGetContextsDevice(context); - if(!Device) + if(Device) { - UnlockLists(); - return; - } - - ReleaseContext(context, Device); - - if(!Device->ContextList) - { - ALCdevice_StopPlayback(Device); - Device->Flags &= ~DEVICE_RUNNING; + ReleaseContext(context, Device); + if(!Device->ContextList) + { + ALCdevice_StopPlayback(Device); + Device->Flags &= ~DEVICE_RUNNING; + } } UnlockLists(); } -- cgit v1.2.3