diff options
author | Chris Robinson <[email protected]> | 2018-11-18 02:52:46 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-18 02:52:46 -0800 |
commit | 310770c53125691135210d76128b5c76ea5a777a (patch) | |
tree | e66dd32762d3f1db5bdd85f766687fc4c7a93751 /Alc | |
parent | 3eededf5d64e197b1c1ed4be883efd0309ca00e0 (diff) |
Add and use new/delete operators to ALeffectslot
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/alc.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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"); } |