X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fquick%2Futil%2Fqquickpixmapcache.cpp;h=6ac5be5f135c77786799016b4223e0485da989e1;hb=d3224ad22a38264aaae81e96384182aee7c1053f;hp=1f4da46ca6efe467f731b4cc6f383f951b1ec7b2;hpb=0408dcd6a9d45e110610c6ed14987189d4e16c90;p=profile%2Fivi%2Fqtdeclarative.git diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index 1f4da46..6ac5be5 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::Iterator iter = store->m_cache.find(key); + QHash::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")) {