aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-02-08 16:58:26 -0800
committerChris Robinson <[email protected]>2010-02-08 16:58:26 -0800
commita329f9c84a154340a61accf5713db522f0a6cf00 (patch)
tree8019ba38d85d62d8c1a95cf532c94da37d57351f
parentfc96e965ae3a4741f57abfd171ac9d3e7776ce9f (diff)
Fix retrieval of the current global context when changing it
-rw-r--r--Alc/ALc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 290e9593..2e2501b3 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1499,8 +1499,13 @@ ALCAPI ALCboolean ALCAPIENTRY alcMakeContextCurrent(ALCcontext *context)
// context must be a valid Context or NULL
if(context == NULL || IsContext(context))
{
- if((ALContext=GetContextSuspended()) != NULL)
+ ALContext = g_pContextList;
+ while(ALContext && !ALContext->InUse)
+ ALContext = ALContext->next;
+
+ if(ALContext != NULL)
{
+ SuspendContext(ALContext);
ALContext->InUse=AL_FALSE;
ProcessContext(ALContext);
}