aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alBuffer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-03-24 13:55:41 -0700
committerChris Robinson <[email protected]>2013-03-24 13:55:41 -0700
commit43b406ad9bb32ebde78d26255a2a4f4a09a29926 (patch)
tree6df448e540966a83070fd1155b9f64a0a00340f5 /OpenAL32/alBuffer.c
parentdd48375bd6569d8695291d68152fe45016bf37b1 (diff)
Simplify al_try code
Diffstat (limited to 'OpenAL32/alBuffer.c')
-rw-r--r--OpenAL32/alBuffer.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 29f3e617..41444ac2 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -198,7 +198,10 @@ AL_API ALvoid AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers)
{
ALbuffer *buffer = calloc(1, sizeof(ALbuffer));
if(!buffer)
+ {
+ alDeleteBuffers(cur, buffers);
al_throwerr(Context, AL_OUT_OF_MEMORY);
+ }
RWLockInit(&buffer->lock);
err = NewThunkEntry(&buffer->id);
@@ -210,17 +213,13 @@ AL_API ALvoid AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers)
memset(buffer, 0, sizeof(ALbuffer));
free(buffer);
+ alDeleteBuffers(cur, buffers);
al_throwerr(Context, err);
}
buffers[cur] = buffer->id;
}
}
- al_catchany()
- {
- if(cur > 0)
- alDeleteBuffers(cur, buffers);
- }
al_endtry;
ALCcontext_DecRef(Context);