aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-08-08 02:48:28 -0700
committerChris Robinson <[email protected]>2010-08-08 02:48:28 -0700
commitf1924fa7eac0e41753d604d8ba3b7f69789e95f8 (patch)
tree74d120dd76aba24cc687230a1de321b44eb0e61f /Alc/ALc.c
parentdf822513fa9656f1a0fea1ef3f895f7ec5cee48c (diff)
Decrement context count when it's removed from the list
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 2a27b34e..5542c5b2 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1712,15 +1712,15 @@ ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context)
if(context == GlobalContext)
GlobalContext = NULL;
- for(i = 0;i < Device->NumContexts-1;i++)
+ for(i = 0;i < Device->NumContexts;i++)
{
if(Device->Contexts[i] == context)
{
Device->Contexts[i] = Device->Contexts[Device->NumContexts-1];
+ Device->NumContexts--;
break;
}
}
- Device->NumContexts--;
// Lock context
SuspendContext(context);