From cd5e90f00ac9f5c217aecde3b718a14d43c34758 Mon Sep 17 00:00:00 2001 From: Lev Zelenskiy Date: Tue, 24 Apr 2012 10:52:16 +1000 Subject: [PATCH] Still need to count usage even when capacity is zero. When the sample is removed we need to decrease sample cache usage, even when capacity is set to zero. Otherwise we're getting wrong usage after capacity is changed. Change-Id: I38820c0f9441abec3086189698ec5a904e1e9b6f Reviewed-by: Ling Hu Reviewed-by: Michael Goddard --- src/multimedia/audio/qsamplecache_p.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/multimedia/audio/qsamplecache_p.cpp b/src/multimedia/audio/qsamplecache_p.cpp index addc03d..0ae070a 100644 --- a/src/multimedia/audio/qsamplecache_p.cpp +++ b/src/multimedia/audio/qsamplecache_p.cpp @@ -287,8 +287,7 @@ bool QSampleCache::notifyUnreferencedSample(QSample* sample) if (m_capacity > 0) return false; m_samples.remove(sample->m_url); - m_staleSamples.insert(sample); - sample->deleteLater(); + unloadSample(sample); return true; } -- 2.7.4