From 339465c91f1317f3c6f441c98658d933984a5291 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 29 Jul 2022 01:49:30 -0700 Subject: Use an intrusive_ptr to hold on to the EffectState --- al/auxeffectslot.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'al/auxeffectslot.cpp') diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index 0f0a20f8..5f58d730 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -917,7 +917,7 @@ ALeffectslot::ALeffectslot(ALCcontext *context) mSlot = context->getEffectSlot(); mSlot->InUse = true; - mSlot->mEffectState = state.release(); + mSlot->mEffectState = std::move(state); } ALeffectslot::~ALeffectslot() @@ -929,16 +929,14 @@ ALeffectslot::~ALeffectslot() DecrementRef(Buffer->ref); Buffer = nullptr; - EffectSlotProps *props{mSlot->Update.exchange(nullptr)}; - if(props) + if(EffectSlotProps *props{mSlot->Update.exchange(nullptr)}) { TRACE("Freed unapplied AuxiliaryEffectSlot update %p\n", decltype(std::declval()){props}); delete props; } - if(mSlot->mEffectState) - mSlot->mEffectState->release(); + mSlot->mEffectState = nullptr; mSlot->InUse = false; } -- cgit v1.2.3