aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/util')
-rw-r--r--src/quick/util/qquickpixmapcache.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 1f4da46ca6..6ac5be5f13 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -902,7 +902,10 @@ void QQuickPixmapData::release()
}
if (pixmapStatus == QQuickPixmap::Ready) {
- pixmapStore()->unreferencePixmap(this);
+ if (inCache)
+ pixmapStore()->unreferencePixmap(this);
+ else
+ delete this;
} else {
removeFromCache();
delete this;
@@ -1163,7 +1166,12 @@ void QQuickPixmap::load(QQmlEngine *engine, const QUrl &url, const QSize &reques
QQuickPixmapKey key = { &url, &requestSize };
QQuickPixmapStore *store = pixmapStore();
- QHash<QQuickPixmapKey, QQuickPixmapData *>::Iterator iter = store->m_cache.find(key);
+ QHash<QQuickPixmapKey, QQuickPixmapData *>::Iterator iter = store->m_cache.end();
+
+ // If Cache is disabled, the pixmap will always be loaded, even if there is an existing
+ // cached version.
+ if (options & QQuickPixmap::Cache)
+ iter = store->m_cache.find(key);
if (iter == store->m_cache.end()) {
if (url.scheme() == QLatin1String("image")) {