Fix GPU texture leak in free_sprite_data()

The decorations_map texture was never freed due to a typo - the code
checked decorations_map.texture_id but then freed sprite_map.texture_id
(which was already freed on the previous line).

This leaked ~1-4 MB of GPU memory each time a font group was deleted,
which occurs when changing font size or reloading font configuration.
This commit is contained in:
Daniel M German 2026-01-31 16:05:49 -08:00
parent 524fe6ae3b
commit 6b44d8520e

View file

@ -118,7 +118,7 @@ free_sprite_data(FONTS_DATA_HANDLE fg) {
SpriteMap *sprite_map = (SpriteMap*)fg->sprite_map;
if (sprite_map) {
if (sprite_map->texture_id) free_texture(&sprite_map->texture_id);
if (sprite_map->decorations_map.texture_id) free_texture(&sprite_map->texture_id);
if (sprite_map->decorations_map.texture_id) free_texture(&sprite_map->decorations_map.texture_id);
free(sprite_map);
fg->sprite_map = NULL;
}