Don't try to clear empty bitmap cache.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18310
This commit is contained in:
Alex Shvartzkop 2024-07-01 18:22:43 +03:00
parent 21ead15872
commit e5a5b59ac1
1 changed files with 2 additions and 1 deletions

View File

@ -262,7 +262,8 @@ GLuint GL_BITMAP_CACHE::cacheBitmap( const BITMAP_BASE* aBitmap )
bmp.accessTime = currentTime; bmp.accessTime = currentTime;
#ifndef DISABLE_BITMAP_CACHE #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 ); KIID toRemove( 0 );
auto toRemoveLru = m_cacheLru.end(); auto toRemoveLru = m_cacheLru.end();