Fix accessing pixmapCache after it is deleted

BUG: 275570
FIXED-IN: 4.7.1
(cherry picked from commit f5b095fdaaae164ef04dd46dfb4fb97a8aa87768)
This commit is contained in:
Christoph Feck 2011-07-30 21:18:38 +02:00
parent ec464cf19a
commit 25869b4e9d

View File

@ -310,11 +310,13 @@ void ThemePrivate::discardCache(CacheTypes caches)
void ThemePrivate::scheduledCacheUpdate() void ThemePrivate::scheduledCacheUpdate()
{ {
if (useCache()) {
QHashIterator<QString, QPixmap> it(pixmapsToCache); QHashIterator<QString, QPixmap> it(pixmapsToCache);
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
pixmapCache->insertPixmap(idsToCache[it.key()], it.value()); pixmapCache->insertPixmap(idsToCache[it.key()], it.value());
} }
}
pixmapsToCache.clear(); pixmapsToCache.clear();
keysToCache.clear(); keysToCache.clear();