fix: don't retry to load RP images that can't fit in the cache
Avoids an infinite loop when the image is too big. Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
074b53eb6b
commit
7705f290ca
@ -47,6 +47,12 @@ void ResourcePack::setImage(QImage new_image)
|
||||
|
||||
m_pack_image_cache_key.key = QPixmapCache::insert(QPixmap::fromImage(new_image));
|
||||
m_pack_image_cache_key.was_ever_used = true;
|
||||
|
||||
// This can happen if the pixmap is too big to fit in the cache :c
|
||||
if (!m_pack_image_cache_key.key.isValid()) {
|
||||
qWarning() << "Could not insert a image cache entry! Ignoring it.";
|
||||
m_pack_image_cache_key.was_ever_used = false;
|
||||
}
|
||||
}
|
||||
|
||||
QPixmap ResourcePack::image(QSize size)
|
||||
|
Loading…
Reference in New Issue
Block a user