summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);