From 0c99a6b316b7e52c12a25d50550291562430834d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 19 Nov 2021 20:04:10 -0800 Subject: Make the backend pointer part of ALCdevice instead of DeviceBase --- core/device.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'core/device.cpp') diff --git a/core/device.cpp b/core/device.cpp index 9705c0ac..2766c5e4 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -1,7 +1,23 @@ #include "config.h" +#include "bformatdec.h" +#include "bs2b.h" #include "device.h" +#include "front_stablizer.h" +#include "hrtf.h" +#include "mastering.h" al::FlexArray DeviceBase::sEmptyContextArray{0u}; + + +DeviceBase::DeviceBase(DeviceType type) : Type{type}, mContexts{&sEmptyContextArray} +{ +} + +DeviceBase::~DeviceBase() +{ + auto *oldarray = mContexts.exchange(nullptr, std::memory_order_relaxed); + if(oldarray != &sEmptyContextArray) delete oldarray; +} -- cgit v1.2.3