aboutsummaryrefslogtreecommitdiffstats
path: root/al
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-07-29 01:49:30 -0700
committerChris Robinson <[email protected]>2022-07-29 01:49:30 -0700
commit339465c91f1317f3c6f441c98658d933984a5291 (patch)
tree66067900764f88b36cfd1eb9f245082ff3e68d9e /al
parentf35eb64619ae91cd786380660e3d90da18f557fb (diff)
Use an intrusive_ptr to hold on to the EffectState
Diffstat (limited to 'al')
-rw-r--r--al/auxeffectslot.cpp8
1 files changed, 3 insertions, 5 deletions
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<void*>()){props});
delete props;
}
- if(mSlot->mEffectState)
- mSlot->mEffectState->release();
+ mSlot->mEffectState = nullptr;
mSlot->InUse = false;
}