aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-06-05 17:09:15 -0700
committerChris Robinson <[email protected]>2019-06-05 17:09:15 -0700
commitf27e73989c9831cde96880edafb01e662a7de2db (patch)
treee3cfab74d1b63187b88af37521d6201c598f38d7
parent142721df17af951212109bf0bdc4203b83fb871e (diff)
Properly destroy the limiter's extra fields
-rw-r--r--Alc/mastering.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/mastering.cpp b/Alc/mastering.cpp
index 00b79e67..f5d36a59 100644
--- a/Alc/mastering.cpp
+++ b/Alc/mastering.cpp
@@ -15,7 +15,7 @@
static_assert((BUFFERSIZE & (BUFFERSIZE-1)) == 0, "BUFFERSIZE is not a power of 2");
struct SlidingHold {
- ALfloat mValues[BUFFERSIZE];
+ alignas(16) ALfloat mValues[BUFFERSIZE];
ALsizei mExpiries[BUFFERSIZE];
ALsizei mLowerIndex;
ALsizei mUpperIndex;
@@ -401,15 +401,15 @@ std::unique_ptr<Compressor> CompressorInit(const ALsizei NumChans, const ALuint
{
if(hold > 1)
{
- Comp->mHold = new (static_cast<void*>(Comp.get() + 1)) SlidingHold{};
+ Comp->mHold = ::new (static_cast<void*>(Comp.get() + 1)) SlidingHold{};
Comp->mHold->mValues[0] = -std::numeric_limits<float>::infinity();
Comp->mHold->mExpiries[0] = hold;
Comp->mHold->mLength = hold;
- Comp->mDelay = new (static_cast<void*>(Comp->mHold + 1)) FloatBufferLine{};
+ Comp->mDelay = ::new (static_cast<void*>(Comp->mHold + 1)) FloatBufferLine[NumChans];
}
else
{
- Comp->mDelay = new (static_cast<void*>(Comp.get() + 1)) FloatBufferLine{};
+ Comp->mDelay = ::new (static_cast<void*>(Comp.get() + 1)) FloatBufferLine[NumChans];
}
}
@@ -423,10 +423,10 @@ std::unique_ptr<Compressor> CompressorInit(const ALsizei NumChans, const ALuint
Compressor::~Compressor()
{
if(mHold)
- mHold->~SlidingHold();
+ al::destroy_at(mHold);
mHold = nullptr;
if(mDelay)
- mDelay->~FloatBufferLine();
+ al::destroy_n(mDelay, mNumChans);
mDelay = nullptr;
}