}
if (pixmapStatus == QQuickPixmap::Ready) {
- pixmapStore()->unreferencePixmap(this);
+ if (inCache)
+ pixmapStore()->unreferencePixmap(this);
+ else
+ delete this;
} else {
removeFromCache();
delete this;
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")) {