aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alBuffer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-06-30 00:10:40 -0700
committerChris Robinson <[email protected]>2014-06-30 00:10:40 -0700
commit22982948cf951924c206b37e80c31532b75c5410 (patch)
treee3f9738d0bb1fd749e4d71d03360ccdd1eb8db28 /OpenAL32/alBuffer.c
parent8f8898b7b0a5c0b1d6aa855b205b433b778e46a1 (diff)
Standardize some New/Delete methods
Diffstat (limited to 'OpenAL32/alBuffer.c')
-rw-r--r--OpenAL32/alBuffer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index b906da14..9f12128e 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -104,7 +104,10 @@ AL_API ALvoid AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers)
}
for(i = 0;i < n;i++)
- DeleteBuffer(device, buffers[i]);
+ {
+ if((ALBuf=LookupBuffer(device, buffers[i])) != NULL)
+ DeleteBuffer(device, ALBuf);
+ }
done:
ALCcontext_DecRef(context);
@@ -1294,12 +1297,9 @@ ALbuffer *NewBuffer(ALCcontext *context)
return buffer;
}
-void DeleteBuffer(ALCdevice *device, ALuint bufid)
+void DeleteBuffer(ALCdevice *device, ALbuffer *buffer)
{
- ALbuffer *buffer;
-
- if((buffer=RemoveBuffer(device, bufid)) == NULL)
- return;
+ RemoveBuffer(device, buffer->id);
FreeThunkEntry(buffer->id);
free(buffer->data);