diff options
author | Chris Robinson <[email protected]> | 2009-05-31 11:54:49 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-05-31 11:54:49 -0700 |
commit | 3c122b0bef6f718f2a55e0b27f712e7accf89376 (patch) | |
tree | 10cb82b38f2b870f5d5cba442f48950c1e434afd /Alc | |
parent | 7940003d0624d76e798523577d3d97cf99b73c83 (diff) |
Set an error if effect creation fails
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/alcEcho.c | 5 | ||||
-rw-r--r-- | Alc/alcReverb.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c index 7185e125..deaae622 100644 --- a/Alc/alcEcho.c +++ b/Alc/alcEcho.c @@ -26,6 +26,7 @@ #include "alMain.h" #include "alFilter.h" #include "alAuxEffectSlot.h" +#include "alError.h" #include "alu.h" typedef struct ALechoState { @@ -160,7 +161,10 @@ ALeffectState *EchoCreate(ALCcontext *Context) state = malloc(sizeof(*state)); if(!state) + { + alSetError(AL_OUT_OF_MEMORY); return NULL; + } state->state.Destroy = EchoDestroy; state->state.Update = EchoUpdate; @@ -176,6 +180,7 @@ ALeffectState *EchoCreate(ALCcontext *Context) if(!state->SampleBuffer) { free(state); + alSetError(AL_OUT_OF_MEMORY); return NULL; } diff --git a/Alc/alcReverb.c b/Alc/alcReverb.c index 846d3802..42c823ce 100644 --- a/Alc/alcReverb.c +++ b/Alc/alcReverb.c @@ -28,6 +28,7 @@ #include "alMain.h" #include "alAuxEffectSlot.h" #include "alEffect.h" +#include "alError.h" #include "alu.h" typedef struct DelayLine @@ -665,7 +666,10 @@ ALeffectState *VerbCreate(ALCcontext *Context) State = malloc(sizeof(ALverbState)); if(!State) + { + alSetError(AL_OUT_OF_MEMORY); return NULL; + } State->state.Destroy = VerbDestroy; State->state.Update = VerbUpdate; @@ -710,6 +714,7 @@ ALeffectState *VerbCreate(ALCcontext *Context) if(!State->SampleBuffer) { free(State); + alSetError(AL_OUT_OF_MEMORY); return NULL; } for(index = 0; index < totalLength;index++) |