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 <ling.hu@nokia.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
Lev Zelenskiy
2012-04-24 10:52:16 +10:00
committed by Qt by Nokia
parent c718043588
commit cd5e90f00a

View File

@@ -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;
}