diff --git a/launcher/MTPixmapCache.h b/launcher/MTPixmapCache.h index a14882097..5f8212d74 100644 --- a/launcher/MTPixmapCache.h +++ b/launcher/MTPixmapCache.h @@ -5,6 +5,7 @@ #include #include #include +#include #define GET_TYPE() \ Qt::ConnectionType type; \ @@ -112,16 +113,16 @@ class PixmapCache final : public QObject { m_last_cache_miss_by_eviciton = now; if (m_consecutive_fast_evicitons >= m_consecutive_fast_evicitons_threshold) { // double the cache size - auto newSize = _cacheLimit() * 2; - if (newSize <= 0) { // double it until you overflow :D + auto newSize = _cacheLimit() * 2.L; + if (newSize >= std::numeric_limits::max()) { // double it until you overflow :D + newSize = std::numeric_limits::max(); qDebug() << m_consecutive_fast_evicitons << tr("pixmap cache misses by eviction happened too fast, doing nothing as the cache size reached it's limit"); - m_consecutive_fast_evicitons = 0; - return true; + } else { + qDebug() << m_consecutive_fast_evicitons << tr("pixmap cache misses by eviction happened too fast, doubling cache size to") + << static_cast(newSize); } - qDebug() << m_consecutive_fast_evicitons << tr("pixmap cache misses by eviction happened too fast, doubling cache size to") - << newSize; - _setCacheLimit(newSize); + _setCacheLimit(static_cast(newSize)); m_consecutive_fast_evicitons = 0; return true; }