aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-07-21 14:50:39 -0700
committerChris Robinson <[email protected]>2010-07-21 14:50:39 -0700
commit88f236ccd3f2e75d0823414e8c9a4492ddbd2539 (patch)
tree5a14a9b486a2a07566858a4691d53cf79737f1ca /Alc
parent34a0c998cd849ab40a1e6325b37ca53c2740c355 (diff)
Make sure the device is stopped if there was an error setting up the first context
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 3c43c7a5..02e04e58 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1612,6 +1612,8 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
{
alcSetError(device, ALC_OUT_OF_MEMORY);
ProcessContext(NULL);
+ if(device->NumContexts == 0)
+ ALCdevice_StopPlayback(device);
return NULL;
}
device->Contexts = temp;
@@ -1628,6 +1630,8 @@ 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);
return NULL;
}