aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-29 03:04:32 -0700
committerChris Robinson <[email protected]>2011-05-29 03:04:32 -0700
commit91c3cffe419befc6d77f1b194fbf9165de7d6f19 (patch)
tree9ac2d494f4335a667455f765aa45c65d058cfa91 /Alc
parent60a55aa89714e06d547b294ae71902a72fef59c4 (diff)
Protect the mixer while the device's context array is being updated
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 46177332..cc3a93a4 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1998,6 +1998,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
return NULL;
}
+ SuspendContext(NULL);
ALContext = NULL;
temp = realloc(device->Contexts, (device->NumContexts+1) * sizeof(*device->Contexts));
if(temp)
@@ -2016,13 +2017,13 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
{
free(ALContext);
alcSetError(device, ALC_OUT_OF_MEMORY);
+ ProcessContext(NULL);
if(device->NumContexts == 0)
ALCdevice_StopPlayback(device);
UnlockLists();
return NULL;
}
- SuspendContext(NULL);
device->Contexts[device->NumContexts++] = ALContext;
ALContext->Device = device;