aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alc.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-25 08:42:43 -0800
committerChris Robinson <[email protected]>2018-11-25 08:42:43 -0800
commitbf4518fe5cbe708b3d6b44855f05b58008a48cc8 (patch)
tree60482d67644528cdbfcdb6d31691be1947362dc4 /Alc/alc.cpp
parent7c0605f09eabb55cd3f1b85474b31bfae584cde9 (diff)
Atuomatically clean up sources with its sublist's destruction
Diffstat (limited to 'Alc/alc.cpp')
-rw-r--r--Alc/alc.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index ec7af970..9919d011 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -2598,11 +2598,11 @@ ALCcontext_struct::~ALCcontext_struct()
al_free(ActiveAuxSlots.exchange(nullptr, std::memory_order_relaxed));
DefaultSlot = nullptr;
- ReleaseALSources(this);
- std::for_each(SourceList.begin(), SourceList.end(),
- [](const SourceSubList &entry) noexcept -> void
- { al_free(entry.Sources); }
- );
+ count = 0;
+ for(auto &sublist : SourceList)
+ count += POPCNT64(~sublist.FreeMask);
+ if(count > 0)
+ WARN(SZFMT " Source%s not deleted\n", count, (count==1)?"":"s");
SourceList.clear();
NumSources = 0;
almtx_destroy(&SourceLock);