diff options
Diffstat (limited to 'OpenAL32/alFilter.cpp')
-rw-r--r-- | OpenAL32/alFilter.cpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/OpenAL32/alFilter.cpp b/OpenAL32/alFilter.cpp index 5b15e7e0..390432cb 100644 --- a/OpenAL32/alFilter.cpp +++ b/OpenAL32/alFilter.cpp @@ -622,24 +622,16 @@ AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *va } -void ReleaseALFilters(ALCdevice *device) +FilterSubList::~FilterSubList() { - size_t leftover = 0; - for(auto &sublist : device->FilterList) + ALuint64 usemask = ~FreeMask; + while(usemask) { - ALuint64 usemask = ~sublist.FreeMask; - while(usemask) - { - ALsizei idx = CTZ64(usemask); - ALfilter *filter = sublist.Filters + idx; - - filter->~ALfilter(); - ++leftover; - - usemask &= ~(U64(1) << idx); - } - sublist.FreeMask = ~usemask; + ALsizei idx = CTZ64(usemask); + Filters[idx].~ALfilter(); + usemask &= ~(U64(1) << idx); } - if(leftover > 0) - WARN("(%p) Deleted " SZFMT " Filter%s\n", device, leftover, (leftover==1)?"":"s"); + FreeMask = ~usemask; + al_free(Filters); + Filters = nullptr; } |