mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 886660 - Fix the leak in FFTBlock::SetFFTSize(); r=roc
This commit is contained in:
parent
d34c9f81ce
commit
17e7067306
@ -28,8 +28,7 @@ public:
|
||||
}
|
||||
~FFTBlock()
|
||||
{
|
||||
free(mFFT);
|
||||
free(mIFFT);
|
||||
Clear();
|
||||
}
|
||||
|
||||
void PerformFFT(const float* aData)
|
||||
@ -68,7 +67,7 @@ public:
|
||||
mFFTSize = aSize;
|
||||
mOutputBuffer.SetLength(aSize / 2 + 1);
|
||||
PodZero(mOutputBuffer.Elements(), aSize / 2 + 1);
|
||||
mFFT = mIFFT = nullptr;
|
||||
Clear();
|
||||
}
|
||||
|
||||
uint32_t FFTSize() const
|
||||
@ -97,6 +96,12 @@ private:
|
||||
mIFFT = kiss_fftr_alloc(mFFTSize, 1, nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
void Clear()
|
||||
{
|
||||
free(mFFT);
|
||||
free(mIFFT);
|
||||
mFFT = mIFFT = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
kiss_fftr_cfg mFFT, mIFFT;
|
||||
|
Loading…
Reference in New Issue
Block a user