diff options
author | Chris Robinson <[email protected]> | 2018-11-25 15:30:32 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-25 15:30:32 -0800 |
commit | 8ae07ad1ae2d957f65ba54fdcd19649eceeb0e3d (patch) | |
tree | b26085490d71fdb2e0968bfd79c90c3dd3613764 /Alc | |
parent | 05845b53e889c2104a5436ff5418c5e2ba5dcbf3 (diff) |
Automatically clean up buffers with ther sublist
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/alc.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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); |