diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-04-27 22:04:23 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-04-27 22:04:23 (GMT) |
commit | de61a3cf52efa43b258f9c19dfe4d984fc629324 (patch) | |
tree | 9a4e887852aa9be12168d802ff0a5ec61ea85b49 /src/gui/image | |
parent | 8af3500125a03a54dddb8c46ee709b7b8d257f27 (diff) | |
parent | 572d3b04aacfd211ea930ac5460562d8b3f6232b (diff) | |
download | Qt-de61a3cf52efa43b258f9c19dfe4d984fc629324.zip Qt-de61a3cf52efa43b258f9c19dfe4d984fc629324.tar.gz Qt-de61a3cf52efa43b258f9c19dfe4d984fc629324.tar.bz2 |
Merge branch '4.5' of git@scm.dev.troll.no:qt/qt
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpixmapcache.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index eedb6a3..458d6b9 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -187,6 +187,11 @@ bool QPMCache::insert(const QString& key, const QPixmap &pixmap, int cost) cacheKeys.insert(key, cacheKey); return true; } + qint64 oldCacheKey = cacheKeys.value(key, -1); + //If for the same key we add already a pixmap we should delete it + if (oldCacheKey != -1) + QCache<qint64, QDetachedPixmap>::remove(oldCacheKey); + bool success = QCache<qint64, QDetachedPixmap>::insert(cacheKey, new QDetachedPixmap(pixmap), cost); if (success) { cacheKeys.insert(key, cacheKey); |