From 65f7fc610e6a6101509906c0c9bbbd794c9a3737 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 1 Aug 2019 13:28:53 -0700 Subject: Add a common base for auto-deleting ref-counted objects Which will also work as the basis for a future intrusive_ptr --- alc/effects/base.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'alc/effects') diff --git a/alc/effects/base.h b/alc/effects/base.h index 4f48de22..89a9e8e4 100644 --- a/alc/effects/base.h +++ b/alc/effects/base.h @@ -5,7 +5,7 @@ #include "almalloc.h" #include "alspan.h" #include "atomic.h" - +#include "intrusive_ptr.h" struct ALeffectslot; @@ -149,9 +149,7 @@ struct EffectTarget { RealMixParams *RealOut; }; -struct EffectState { - RefCount mRef{1u}; - +struct EffectState : public al::intrusive_ref { al::span mOutTarget; @@ -160,9 +158,6 @@ struct EffectState { virtual ALboolean deviceUpdate(const ALCdevice *device) = 0; virtual void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) = 0; virtual void process(const ALsizei samplesToDo, const FloatBufferLine *RESTRICT samplesIn, const ALsizei numInput, const al::span samplesOut) = 0; - - void IncRef() noexcept; - void DecRef() noexcept; }; -- cgit v1.2.3