qt-bugs@ issue : none Qt Software task ID : none bugs.kde.org number : 183191 applied: yes author: Alexis Menard Make sure that QPixmapCache release the old pixmap if you reinsert a QPixmap with the same key. This patch is already in 4.5 branch. --- src/gui/image/qpixmapcache.cpp +++ 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::remove(oldCacheKey); + bool success = QCache::insert(cacheKey, new QDetachedPixmap(pixmap), cost); if (success) { cacheKeys.insert(key, cacheKey);