Skip to content

Commit

Permalink
lvfntman: fix LVFontGlobalGlyphCache::removeNoLock (#532)
Browse files Browse the repository at this point in the history
The cache size was not updated when removing the last item.
Potential impact: negligible, between 64 and 316 bytes on each book
opening after the first one, resulting in a ~1% reduction in usable
cache size after opening 17 books.
  • Loading branch information
benoit-pierre authored Oct 13, 2023
1 parent 8483fb4 commit 60c633b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crengine/src/lvfntman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,7 @@ void LVFontGlobalGlyphCache::remove( LVFontGlyphCacheItem * item )

void LVFontGlobalGlyphCache::removeNoLock( LVFontGlyphCacheItem * item )
{
size -= item->getSize();
if ( item==head )
head = item->next_global;
if ( item==tail )
Expand All @@ -1282,7 +1283,6 @@ void LVFontGlobalGlyphCache::removeNoLock( LVFontGlyphCacheItem * item )
item->next_global->prev_global = item->prev_global;
item->next_global = NULL;
item->prev_global = NULL;
size -= item->getSize();
}

void LVFontGlobalGlyphCache::clear()
Expand Down

0 comments on commit 60c633b

Please sign in to comment.