summaryrefslogtreecommitdiff
path: root/src/audiocache.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-05-07 15:47:51 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2017-05-07 15:47:51 +0200
commitb92b7d517b51831f77c54da88974fbaca8bd763c (patch)
tree0c45bd3e4ab0e88828761402ce8cf72df4ce3336 /src/audiocache.cc
parent061b57ab6fd530f41d75a3b52dd254edc509a96b (diff)
Lazy free the nodata buffers on plugin removal.
Diffstat (limited to 'src/audiocache.cc')
-rw-r--r--src/audiocache.cc5
1 files changed, 4 insertions, 1 deletions
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;