aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/alBuffer.cpp')
-rw-r--r--OpenAL32/alBuffer.cpp32
1 files changed, 9 insertions, 23 deletions
diff --git a/OpenAL32/alBuffer.cpp b/OpenAL32/alBuffer.cpp
index 5c40a27e..3716ac28 100644
--- a/OpenAL32/alBuffer.cpp
+++ b/OpenAL32/alBuffer.cpp
@@ -1174,30 +1174,16 @@ ALsizei ChannelsFromFmt(FmtChannels chans)
}
-/*
- * ReleaseALBuffers()
- *
- * INTERNAL: Called to destroy any buffers that still exist on the device
- */
-ALvoid ReleaseALBuffers(ALCdevice *device)
+BufferSubList::~BufferSubList()
{
- size_t leftover = 0;
- for(auto &sublist : device->BufferList)
+ ALuint64 usemask = ~FreeMask;
+ while(usemask)
{
- ALuint64 usemask = ~sublist.FreeMask;
- while(usemask)
- {
- ALsizei idx = CTZ64(usemask);
- ALbuffer *buffer = sublist.Buffers + idx;
-
- buffer->~ALbuffer();
-
- ++leftover;
-
- usemask &= ~(U64(1) << idx);
- }
- sublist.FreeMask = ~usemask;
+ ALsizei idx{CTZ64(usemask)};
+ Buffers[idx].~ALbuffer();
+ usemask &= ~(U64(1) << idx);
}
- if(leftover > 0)
- WARN("(%p) Deleted " SZFMT " Buffer%s\n", device, leftover, (leftover==1)?"":"s");
+ FreeMask = ~usemask;
+ al_free(Buffers);
+ Buffers = nullptr;
}