diff options
author | Chris Robinson <[email protected]> | 2020-08-22 22:45:26 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-08-24 14:09:26 -0700 |
commit | ff5c9d1c15302473be7e0ea3b5da2643549e8d6c (patch) | |
tree | 9e8e1f07cd2a1c28fd3bc75f41f1cd552c570079 /alc | |
parent | 01f76f2b671c21c976b1f88c18845a53000afa6b (diff) |
Use an intrusive_ptr for ALeffectslotProps::State
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alc.cpp | 1 | ||||
-rw-r--r-- | alc/alu.cpp | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index c349a4ba..edefe9a1 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -2353,7 +2353,6 @@ ALCcontext::~ALCcontext() while(eprops) { ALeffectslotProps *next{eprops->next.load(std::memory_order_relaxed)}; - if(eprops->State) eprops->State->release(); delete eprops; eprops = next; ++count; diff --git a/alc/alu.cpp b/alc/alu.cpp index a5172fb7..aed79b14 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -476,8 +476,7 @@ bool CalcEffectSlotParams(ALeffectslot *slot, ALeffectslot **sorted_slots, ALCco slot->Params.AirAbsorptionGainHF = 1.0f; } - EffectState *state{props->State}; - props->State = nullptr; + EffectState *state{props->State.release()}; EffectState *oldstate{slot->Params.mEffectState}; slot->Params.mEffectState = state; @@ -502,7 +501,7 @@ bool CalcEffectSlotParams(ALeffectslot *slot, ALeffectslot **sorted_slots, ALCco * cleaned up sometime later (not ideal, but better than blocking * or leaking). */ - props->State = oldstate; + props->State.reset(oldstate); } } |