aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-10 19:19:32 -0700
committerChris Robinson <[email protected]>2011-09-10 19:19:32 -0700
commitb788ae52b0d966766d2cd56813a10c4936afe3f7 (patch)
tree376c308a5e1415c9277176cdfe844d0d18ad4174 /Alc/ALc.c
parentccbd67eab6fc2b019dfc05f7c7fb6d2290173356 (diff)
Condense some code
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c19
1 files changed, 8 insertions, 11 deletions
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();
}