diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/util/qdeclarativepixmapcache.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quick/util/qdeclarativepixmapcache.cpp b/src/quick/util/qdeclarativepixmapcache.cpp index 15a46375da..6460136775 100644 --- a/src/quick/util/qdeclarativepixmapcache.cpp +++ b/src/quick/util/qdeclarativepixmapcache.cpp @@ -707,17 +707,20 @@ private: int m_unreferencedCost; int m_timerId; + bool m_destroying; }; Q_GLOBAL_STATIC(QDeclarativePixmapStore, pixmapStore); QDeclarativePixmapStore::QDeclarativePixmapStore() -: m_unreferencedPixmaps(0), m_lastUnreferencedPixmap(0), m_unreferencedCost(0), m_timerId(-1) + : m_unreferencedPixmaps(0), m_lastUnreferencedPixmap(0), m_unreferencedCost(0), m_timerId(-1), m_destroying(false) { } QDeclarativePixmapStore::~QDeclarativePixmapStore() { + m_destroying = true; + int leakedPixmaps = 0; QList<QDeclarativePixmapData*> cachedData = m_cache.values(); @@ -764,7 +767,7 @@ void QDeclarativePixmapStore::unreferencePixmap(QDeclarativePixmapData *data) shrinkCache(-1); // Shrink the cache incase it has become larger than cache_limit - if (m_timerId == -1 && m_unreferencedPixmaps) + if (m_timerId == -1 && m_unreferencedPixmaps && !m_destroying) m_timerId = startTimer(CACHE_EXPIRE_TIME * 1000); } |