summaryrefslogtreecommitdiffstats
path: root/src/openvg/qvgimagepool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvg/qvgimagepool.cpp')
-rw-r--r--src/openvg/qvgimagepool.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/openvg/qvgimagepool.cpp b/src/openvg/qvgimagepool.cpp
index 78277aa..0c236ea 100644
--- a/src/openvg/qvgimagepool.cpp
+++ b/src/openvg/qvgimagepool.cpp
@@ -154,16 +154,23 @@ bool QVGImagePool::reclaimSpace(VGImageFormat format,
Q_UNUSED(width);
Q_UNUSED(height);
- if (data)
+ bool succeeded = false;
+ bool wasInLRU = false;
+ if (data) {
+ wasInLRU = data->inLRU;
moveToHeadOfLRU(data);
+ }
QVGPixmapData *lrudata = pixmapLRU();
if (lrudata && lrudata != data) {
lrudata->reclaimImages();
- return true;
+ succeeded = true;
}
- return false;
+ if (data && !wasInLRU)
+ removeFromLRU(data);
+
+ return succeeded;
}
void QVGImagePool::hibernate()