aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alEffect.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-27 20:04:21 -0800
committerChris Robinson <[email protected]>2018-01-27 20:04:21 -0800
commite12059a31186605ce2ed534ba42004edf3df5a6b (patch)
tree9beb7aa3e16f60facc42e3671f232bb228747ba0 /OpenAL32/alEffect.c
parentcb9fb3121499b02efd7ce513ea95173a3ce64f4c (diff)
Fix error reporting for resource generation
Diffstat (limited to 'OpenAL32/alEffect.c')
-rw-r--r--OpenAL32/alEffect.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c
index 797687fa..0fa2ee08 100644
--- a/OpenAL32/alEffect.c
+++ b/OpenAL32/alEffect.c
@@ -83,9 +83,8 @@ AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
if(!context) return;
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, done, "Generating %d effects", n);
-
- for(cur = 0;cur < n;cur++)
+ alSetError(context, AL_INVALID_VALUE, "Generating %d effects", n);
+ else for(cur = 0;cur < n;cur++)
{
ALeffect *effect = AllocEffect(context);
if(!effect)
@@ -96,7 +95,6 @@ AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
effects[cur] = effect->id;
}
-done:
ALCcontext_DecRef(context);
}
@@ -407,6 +405,7 @@ static ALeffect *AllocEffect(ALCcontext *context)
if(UNLIKELY(VECTOR_SIZE(device->EffectList) >= 1<<25))
{
almtx_unlock(&device->EffectLock);
+ alSetError(context, AL_OUT_OF_MEMORY, "Too many effects allocated");
return NULL;
}
lidx = (ALsizei)VECTOR_SIZE(device->EffectList);
@@ -418,6 +417,7 @@ static ALeffect *AllocEffect(ALCcontext *context)
{
VECTOR_POP_BACK(device->EffectList);
almtx_unlock(&device->EffectLock);
+ alSetError(context, AL_OUT_OF_MEMORY, "Failed to allocate effect batch");
return NULL;
}