aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-25 16:13:07 -0800
committerChris Robinson <[email protected]>2018-11-25 16:16:40 -0800
commit127ec026e7dd0722bd5fbc193a85cb28a95925f5 (patch)
treeb59e28ab8dbe140bb9260728de4d8980371c906d /Alc
parent8ae07ad1ae2d957f65ba54fdcd19649eceeb0e3d (diff)
Automatically clean up filters and effects with their sublists
Diffstat (limited to 'Alc')
-rw-r--r--Alc/alc.cpp20
1 files changed, 10 insertions, 10 deletions
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);