From 127ec026e7dd0722bd5fbc193a85cb28a95925f5 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 25 Nov 2018 16:13:07 -0800 Subject: Automatically clean up filters and effects with their sublists --- Alc/alc.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Alc') diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 34279269..56bfb875 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -2404,19 +2404,19 @@ ALCdevice_struct::~ALCdevice_struct() BufferList.clear(); almtx_destroy(&BufferLock); - ReleaseALEffects(this); - std::for_each(EffectList.begin(), EffectList.end(), - [](EffectSubList &entry) noexcept -> void - { al_free(entry.Effects); } - ); + count = 0; + for(auto &sublist : EffectList) + count += POPCNT64(~sublist.FreeMask); + if(count > 0) + WARN(SZFMT " Effect%s not deleted\n", count, (count==1)?"":"s"); EffectList.clear(); almtx_destroy(&EffectLock); - ReleaseALFilters(this); - std::for_each(FilterList.begin(), FilterList.end(), - [](FilterSubList &entry) noexcept -> void - { al_free(entry.Filters); } - ); + count = 0; + for(auto &sublist : FilterList) + count += POPCNT64(~sublist.FreeMask); + if(count > 0) + WARN(SZFMT " Filter%s not deleted\n", count, (count==1)?"":"s"); FilterList.clear(); almtx_destroy(&FilterLock); -- cgit v1.2.3