From 310770c53125691135210d76128b5c76ea5a777a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 18 Nov 2018 02:52:46 -0800 Subject: Add and use new/delete operators to ALeffectslot --- Alc/alc.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Alc') diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 66c19b86..6aec72d0 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -2707,6 +2707,7 @@ static void FreeContext(ALCcontext *context) if(context->DefaultSlot) { DeinitEffectSlot(context->DefaultSlot); + delete context->DefaultSlot; context->DefaultSlot = nullptr; } @@ -3812,14 +3813,14 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin } AllocateVoices(ALContext, 256, device->NumAuxSends); - // FIXME: Reenable after the default effect slot is handled again - if(0 && DefaultEffect.type != AL_EFFECT_NULL && device->Type == Playback) + if(DefaultEffect.type != AL_EFFECT_NULL && device->Type == Playback) { - ALContext->DefaultSlot = nullptr; + ALContext->DefaultSlot = new ALeffectslot{}; if(InitEffectSlot(ALContext->DefaultSlot) == AL_NO_ERROR) aluInitEffectPanning(ALContext->DefaultSlot); else { + delete ALContext->DefaultSlot; ALContext->DefaultSlot = nullptr; ERR("Failed to initialize the default effect slot\n"); } -- cgit v1.2.3