QQuickPixmapStore: Don't start expiration timer when application quits
authorOleg Shparber <trollixx@gmail.com>
Mon, 7 Jul 2014 21:56:38 +0000 (14:56 -0700)
committerOleg Shparber <trollixx@gmail.com>
Wed, 1 Oct 2014 22:58:12 +0000 (00:58 +0200)
This change removes a warning printed during application closing
stage about a timer started not from QThread.

Change-Id: I93ca4da7066bd5e0784509676bc59969a8e2ad48
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
src/quick/util/qquickpixmapcache.cpp

index 818e6fb..3e94d0c 100644 (file)
@@ -804,8 +804,10 @@ void QQuickPixmapStore::unreferencePixmap(QQuickPixmapData *data)
 
     shrinkCache(-1); // Shrink the cache in case it has become larger than cache_limit
 
-    if (m_timerId == -1 && m_unreferencedPixmaps && !m_destroying)
+    if (m_timerId == -1 && m_unreferencedPixmaps
+            && !m_destroying && !QCoreApplication::closingDown()) {
         m_timerId = startTimer(CACHE_EXPIRE_TIME * 1000);
+    }
 }
 
 void QQuickPixmapStore::referencePixmap(QQuickPixmapData *data)