$NetBSD: patch-az,v 1.1 2009/06/29 12:54:19 drochner Exp $

--- src/gui/image/qpixmapcache.cpp.orig	2009-04-22 01:57:41.000000000 +0200
+++ src/gui/image/qpixmapcache.cpp
@@ -187,6 +187,11 @@ bool QPMCache::insert(const QString& key
         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);
