aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alAuxEffectSlot.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-18 02:52:46 -0800
committerChris Robinson <[email protected]>2018-11-18 02:52:46 -0800
commit310770c53125691135210d76128b5c76ea5a777a (patch)
treee66dd32762d3f1db5bdd85f766687fc4c7a93751 /OpenAL32/alAuxEffectSlot.cpp
parent3eededf5d64e197b1c1ed4be883efd0309ca00e0 (diff)
Add and use new/delete operators to ALeffectslot
Diffstat (limited to 'OpenAL32/alAuxEffectSlot.cpp')
-rw-r--r--OpenAL32/alAuxEffectSlot.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/OpenAL32/alAuxEffectSlot.cpp b/OpenAL32/alAuxEffectSlot.cpp
index 119bb038..e67571a2 100644
--- a/OpenAL32/alAuxEffectSlot.cpp
+++ b/OpenAL32/alAuxEffectSlot.cpp
@@ -142,13 +142,11 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo
iter = context->EffectSlotList.end() - 1;
}
- ALenum err{AL_OUT_OF_MEMORY};
- auto slot = static_cast<ALeffectslot*>(al_calloc(16, sizeof(ALeffectslot)));
- if(slot) slot = new (slot) ALeffectslot{};
- if(!slot || (err=InitEffectSlot(slot)) != AL_NO_ERROR)
+ auto slot = new ALeffectslot{};
+ ALenum err{InitEffectSlot(slot)};
+ if(err != AL_NO_ERROR)
{
- slot->~ALeffectslot();
- al_free(slot);
+ delete slot;
UnlockEffectSlotList(context);
alDeleteAuxiliaryEffectSlots(cur, effectslots);
@@ -201,9 +199,7 @@ AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *
context->EffectSlotList[effectslots[i]-1] = nullptr;
DeinitEffectSlot(slot);
-
- slot->~ALeffectslot();
- al_free(slot);
+ delete slot;
}
done:
@@ -793,9 +789,8 @@ ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *context)
entry = nullptr;
DeinitEffectSlot(slot);
+ delete slot;
- slot->~ALeffectslot();
- al_free(slot);
++leftover;
}
if(leftover > 0)