aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alEffect.cpp
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 /OpenAL32/alEffect.cpp
parent8ae07ad1ae2d957f65ba54fdcd19649eceeb0e3d (diff)
Automatically clean up filters and effects with their sublists
Diffstat (limited to 'OpenAL32/alEffect.cpp')
-rw-r--r--OpenAL32/alEffect.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/OpenAL32/alEffect.cpp b/OpenAL32/alEffect.cpp
index 2bc60e24..7f479c83 100644
--- a/OpenAL32/alEffect.cpp
+++ b/OpenAL32/alEffect.cpp
@@ -571,26 +571,18 @@ void InitEffect(ALeffect *effect)
InitEffectParams(effect, AL_EFFECT_NULL);
}
-void ReleaseALEffects(ALCdevice *device)
+EffectSubList::~EffectSubList()
{
- size_t leftover = 0;
- for(auto &sublist : device->EffectList)
+ ALuint64 usemask = ~FreeMask;
+ while(usemask)
{
- ALuint64 usemask = ~sublist.FreeMask;
- while(usemask)
- {
- ALsizei idx = CTZ64(usemask);
- ALeffect *effect = sublist.Effects + idx;
-
- effect->~ALeffect();
- ++leftover;
-
- usemask &= ~(U64(1) << idx);
- }
- sublist.FreeMask = ~usemask;
+ ALsizei idx = CTZ64(usemask);
+ Effects[idx].~ALeffect();
+ usemask &= ~(U64(1) << idx);
}
- if(leftover > 0)
- WARN("(%p) Deleted " SZFMT " Effect%s\n", device, leftover, (leftover==1)?"":"s");
+ FreeMask = ~usemask;
+ al_free(Effects);
+ Effects = nullptr;
}