axmol/thirdparty/openal/core/device.cpp

24 lines
476 B
C++
Raw Normal View History

2021-05-14 10:15:42 +08:00
#include "config.h"
2022-04-25 12:02:45 +08:00
#include "bformatdec.h"
#include "bs2b.h"
2021-05-14 10:15:42 +08:00
#include "device.h"
2022-04-25 12:02:45 +08:00
#include "front_stablizer.h"
#include "hrtf.h"
#include "mastering.h"
2021-05-14 10:15:42 +08:00
al::FlexArray<ContextBase*> DeviceBase::sEmptyContextArray{0u};
2022-04-25 12:02:45 +08:00
DeviceBase::DeviceBase(DeviceType type) : Type{type}, mContexts{&sEmptyContextArray}
{
}
DeviceBase::~DeviceBase()
{
auto *oldarray = mContexts.exchange(nullptr, std::memory_order_relaxed);
if(oldarray != &sEmptyContextArray) delete oldarray;
}