Fix deleting the same buffer ID multiple times in one call

This commit is contained in:
Chris Robinson
2018-11-21 11:51:34 -08:00
parent d20522166e
commit dfcc98afbf
+4 -1
View File
@@ -502,7 +502,10 @@ AL_API ALvoid AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers)
/* All good. Delete non-0 buffer IDs. */
std::for_each(buffers, buffers_end,
[device](ALuint bid) -> void
{ if(bid) FreeBuffer(device, LookupBuffer(device, bid)); }
{
ALbuffer *buffer{bid ? LookupBuffer(device, bid) : nullptr};
if(buffer) FreeBuffer(device, buffer);
}
);
}
}