Don't try to clear empty bitmap cache.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18310


(cherry picked from commit e5a5b59ac1)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
This commit is contained in:
dsa-t 2024-07-01 15:23:55 +00:00
parent bd14224b42
commit 7ee8f786f2
1 changed files with 2 additions and 1 deletions

View File

@ -255,7 +255,8 @@ GLuint GL_BITMAP_CACHE::cacheBitmap( const BITMAP_BASE* aBitmap )
bmp.accessTime = currentTime;
#ifndef DISABLE_BITMAP_CACHE
if( m_cacheLru.size() + 1 > m_cacheMaxElements || m_cacheSize + bmp.size > m_cacheMaxSize )
if( ( m_cacheLru.size() + 1 > m_cacheMaxElements || m_cacheSize + bmp.size > m_cacheMaxSize )
&& !m_cacheLru.empty() )
{
KIID toRemove( 0 );
auto toRemoveLru = m_cacheLru.end();