Prevented leak of keys in QPixmapCache.
authorSamuel Rødal <sroedal@trolltech.com>
Thu, 10 Dec 2009 16:22:53 +0000 (17:22 +0100)
committerLuc Devallonné <luc.devallonne@mnemis.com>
Tue, 5 Jan 2010 13:58:54 +0000 (14:58 +0100)
commitec63a199f0ca3fc32de1b1e7362bb38dc6effff1
treeacb5183da24833ca5b302ae5f5180be2445d3f05
parentebced4bff22bea45fec2fc38f902cf4e92a8a748
Prevented leak of keys in QPixmapCache.

Removing a pixmap from the pixmap cache using the new QPixmapCache::Key
API left the keys dangling in the QCache's internal QHash. The problem
is that the Key is invalidated as soon as the QPixmapCacheEntry is
destroyed, thus removing it from the hash failed. Reordering the
destruction of the object and the removal of the key in QHash fixes the
problem.

Reviewed-by: Alexis
Reviewed-by: Thiago
src/corelib/tools/qcache.h
src/gui/image/qpixmapcache.cpp
tests/auto/qpixmapcache/tst_qpixmapcache.cpp