From 2349f29be01e1f6777f60a0397eab69650454c0d Mon Sep 17 00:00:00 2001 From: Trial97 Date: Thu, 2 Nov 2023 01:19:18 +0200 Subject: [PATCH] jsut a overflow protection Signed-off-by: Trial97 --- launcher/MTPixmapCache.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/launcher/MTPixmapCache.h b/launcher/MTPixmapCache.h index 1a3e52160..a14882097 100644 --- a/launcher/MTPixmapCache.h +++ b/launcher/MTPixmapCache.h @@ -113,7 +113,13 @@ class PixmapCache final : public QObject { if (m_consecutive_fast_evicitons >= m_consecutive_fast_evicitons_threshold) { // double the cache size auto newSize = _cacheLimit() * 2; - qDebug() << m_consecutive_fast_evicitons << "pixmap cache misses by eviction happened too fast, doubling cache size to" + if (newSize <= 0) { // double it until you overflow :D + 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; + } + qDebug() << m_consecutive_fast_evicitons << tr("pixmap cache misses by eviction happened too fast, doubling cache size to") << newSize; _setCacheLimit(newSize); m_consecutive_fast_evicitons = 0;