From: Tor Arne Vestbø Date: Fri, 3 Feb 2012 13:11:27 +0000 (+0100) Subject: Don't start timers in the QDeclarativePixmapStore destructor X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=56db0a314ec66655cb56a4690775c58527288342;p=konrad%2Fqtdeclarative.git Don't start timers in the QDeclarativePixmapStore destructor Timers use global static data, which might have been torn down at the point where we start the timer. Change-Id: Id11de05ae92b9a3652f9b1d7c3d5ca4947ffe065 Reviewed-by: João Abecasis Reviewed-by: Simon Hausmann Reviewed-by: Gunnar Sletta --- diff --git a/src/quick/util/qdeclarativepixmapcache.cpp b/src/quick/util/qdeclarativepixmapcache.cpp index 6460136..8035923 100644 --- a/src/quick/util/qdeclarativepixmapcache.cpp +++ b/src/quick/util/qdeclarativepixmapcache.cpp @@ -724,6 +724,11 @@ QDeclarativePixmapStore::~QDeclarativePixmapStore() int leakedPixmaps = 0; QList cachedData = m_cache.values(); + // Prevent unreferencePixmap() from assuming it needs to kick + // off the cache expiry timer, as we're shrinking the cache + // manually below after releasing all the pixmaps. + m_timerId = -2; + // unreference all (leaked) pixmaps foreach (QDeclarativePixmapData* pixmap, cachedData) { int currRefCount = pixmap->refCount;