diff options
author | Chris Robinson <[email protected]> | 2018-11-25 09:23:01 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-25 09:23:01 -0800 |
commit | ec9736035226539d267659d2e6eba2e06c2507ca (patch) | |
tree | ab1b6057217f7a69d1ae69d18c710ff22cdedbde | |
parent | bf4518fe5cbe708b3d6b44855f05b58008a48cc8 (diff) |
Avoid a separate function to clean up effect slots
-rw-r--r-- | Alc/alc.cpp | 6 | ||||
-rw-r--r-- | OpenAL32/Include/alAuxEffectSlot.h | 1 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.cpp | 15 |
3 files changed, 5 insertions, 17 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 9919d011..5fae13b3 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -2619,7 +2619,11 @@ ALCcontext_struct::~ALCcontext_struct() } TRACE("Freed " SZFMT " AuxiliaryEffectSlot property object%s\n", count, (count==1)?"":"s"); - ReleaseALAuxiliaryEffectSlots(this); + count = 0; + for(auto &slot : EffectSlotList) + count += slot ? 1 : 0; + if(count > 0) + WARN(SZFMT " AuxiliaryEffectSlot%s not deleted\n", count, (count==1)?"":"s"); EffectSlotList.clear(); almtx_destroy(&EffectSlotLock); diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h index dd44b436..dfb57140 100644 --- a/OpenAL32/Include/alAuxEffectSlot.h +++ b/OpenAL32/Include/alAuxEffectSlot.h @@ -119,7 +119,6 @@ struct ALeffectslot { ALenum InitEffectSlot(ALeffectslot *slot); void UpdateEffectSlotProps(ALeffectslot *slot, ALCcontext *context); void UpdateAllEffectSlotProps(ALCcontext *context); -ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *Context); EffectStateFactory *NullStateFactory_getFactory(void); diff --git a/OpenAL32/alAuxEffectSlot.cpp b/OpenAL32/alAuxEffectSlot.cpp index 60c44f49..e7991ff0 100644 --- a/OpenAL32/alAuxEffectSlot.cpp +++ b/OpenAL32/alAuxEffectSlot.cpp @@ -656,18 +656,3 @@ void UpdateAllEffectSlotProps(ALCcontext *context) UpdateEffectSlotProps(slot, context); } } - -ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *context) -{ - size_t leftover = 0; - for(auto &entry : context->EffectSlotList) - { - if(entry) - { - entry = nullptr; - ++leftover; - } - } - if(leftover > 0) - WARN("(%p) Deleted " SZFMT " AuxiliaryEffectSlot%s\n", context, leftover, (leftover==1)?"":"s"); -} |