--- keramik/pixmaploader.cpp (revision 559148) +++ keramik/pixmaploader.cpp (working copy) @@ -290,13 +290,17 @@ QPixmap PixmapLoader::scale( int name, i else result = new QPixmap(img->smoothScale( width ? width : img->width(), height ? height: img->height())); + delete img; KeramikCacheEntry* toAdd = new KeramikCacheEntry(entry); toAdd->m_pixmap = result; - m_pixmapCache.insert(key, toAdd, result->width()*result->height()*result->depth()/8); + if (!m_pixmapCache.insert(key, toAdd, result->width()*result->height()*result->depth()/8)) { + QPixmap toRet = *result; + delete toAdd; + return toRet; + } - delete img; return *result; }