diff options
author | Chris Robinson <[email protected]> | 2022-03-05 18:49:46 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-03-05 18:49:46 -0800 |
commit | be3b37b7c91b55f14a69f0fc209bbda1837c20d7 (patch) | |
tree | 6a79e42a654f13ac7bcef64120810e21add94a8e /al/auxeffectslot.cpp | |
parent | 776d62c1d1e6956eff63ebd1ef22c287ecce89bd (diff) |
Avoid a stateful unique_ptr deleter
Diffstat (limited to 'al/auxeffectslot.cpp')
-rw-r--r-- | al/auxeffectslot.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index a83c39f7..9f35142e 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -1766,18 +1766,10 @@ void ALeffectslot::eax_set_effect_slot_gain( } -EaxAlEffectSlotDeleter::EaxAlEffectSlotDeleter( - ALCcontext& context) noexcept - : - context_{&context} -{ -} - -void EaxAlEffectSlotDeleter::operator()( - ALeffectslot* effect_slot) +void ALeffectslot::EaxDeleter::operator()(ALeffectslot* effect_slot) { assert(effect_slot); - eax_delete_al_effect_slot(*context_, *effect_slot); + eax_delete_al_effect_slot(*effect_slot->eax_al_context_, *effect_slot); } @@ -1802,8 +1794,7 @@ EaxAlEffectSlotUPtr eax_create_al_effect_slot( return nullptr; } - auto effect_slot = EaxAlEffectSlotUPtr{AllocEffectSlot(&context), EaxAlEffectSlotDeleter{context}}; - + auto effect_slot = EaxAlEffectSlotUPtr{AllocEffectSlot(&context)}; if (!effect_slot) { ERR(EAX_PREFIX "%s\n", "Failed to allocate."); |