From b92b7d517b51831f77c54da88974fbaca8bd763c Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 7 May 2017 15:47:51 +0200 Subject: Lazy free the nodata buffers on plugin removal. --- src/audiocache.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/audiocache.cc') diff --git a/src/audiocache.cc b/src/audiocache.cc index e3be20b..2e9eaf8 100644 --- a/src/audiocache.cc +++ b/src/audiocache.cc @@ -277,7 +277,10 @@ void AudioCache::setFrameSize(std::size_t framesize) if(framesize > nodata_framesize) { - delete[] nodata; + if(nodata) + { + nodata_dirty.emplace_back(std::move(nodata)); // Store for later deletion. + } nodata = new sample_t[framesize]; nodata_framesize = framesize; -- cgit v1.2.3