From 8ae07ad1ae2d957f65ba54fdcd19649eceeb0e3d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 25 Nov 2018 15:30:32 -0800 Subject: Automatically clean up buffers with ther sublist --- Alc/alc.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Alc/alc.cpp') diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 5fae13b3..34279269 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -2396,11 +2396,11 @@ ALCdevice_struct::~ALCdevice_struct() almtx_destroy(&BackendLock); - ReleaseALBuffers(this); - std::for_each(BufferList.begin(), BufferList.end(), - [](BufferSubList &entry) noexcept -> void - { al_free(entry.Buffers); } - ); + size_t count{0u}; + for(auto &sublist : BufferList) + count += POPCNT64(~sublist.FreeMask); + if(count > 0) + WARN(SZFMT " Buffer%s not deleted\n", count, (count==1)?"":"s"); BufferList.clear(); almtx_destroy(&BufferLock); -- cgit v1.2.3