From 56db0a314ec66655cb56a4690775c58527288342 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 3 Feb 2012 14:11:27 +0100 Subject: [PATCH] Don't start timers in the QDeclarativePixmapStore destructor MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/quick/util/qdeclarativepixmapcache.cpp | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) 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; -- 1.7.2.5