aboutsummaryrefslogtreecommitdiffstats
path: root/al/auxeffectslot.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-08-24 20:34:50 -0700
committerChris Robinson <[email protected]>2020-08-24 20:40:24 -0700
commita6bd53c4e1de084d93541f23d391154d7949b678 (patch)
treef33a98b0e978eaf14191806271fb883f95783a69 /al/auxeffectslot.cpp
parent1a9fbc1b2f7456f14e9cb74d95f4696cbe5c5af3 (diff)
Store a reference to the effect buffer as an active property
Diffstat (limited to 'al/auxeffectslot.cpp')
-rw-r--r--al/auxeffectslot.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp
index 88512bef..790db24f 100644
--- a/al/auxeffectslot.cpp
+++ b/al/auxeffectslot.cpp
@@ -702,6 +702,8 @@ ALeffectslot::~ALeffectslot()
if(Params.mEffectState)
Params.mEffectState->release();
+ if(Params.mEffectBuffer)
+ Params.mEffectBuffer->release();
}
ALenum ALeffectslot::init()
@@ -764,6 +766,7 @@ ALenum ALeffectslot::initEffect(ALeffect *effect, ALCcontext *context)
while(props)
{
props->State = nullptr;
+ props->Buffer = nullptr;
props = props->next.load(std::memory_order_relaxed);
}
@@ -792,10 +795,8 @@ void ALeffectslot::updateProps(ALCcontext *context)
props->Type = Effect.Type;
props->Props = Effect.Props;
- /* Swap out any stale effect state object there may be in the container, to
- * delete it.
- */
props->State = Effect.State;
+ props->Buffer = Effect.Buffer;
/* Set the new container for updating internal parameters. */
props = Params.Update.exchange(props, std::memory_order_acq_rel);
@@ -805,6 +806,7 @@ void ALeffectslot::updateProps(ALCcontext *context)
* freelist.
*/
props->State = nullptr;
+ props->Buffer = nullptr;
AtomicReplaceHead(context->mFreeEffectslotProps, props);
}
}