From 6b44d8520e9cfc4748b4c9119480f1d9f1b08e38 Mon Sep 17 00:00:00 2001 From: Daniel M German Date: Sat, 31 Jan 2026 16:05:49 -0800 Subject: [PATCH] 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. --- kitty/shaders.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/shaders.c b/kitty/shaders.c index f5ccd64fd..e53e849ed 100644 --- a/kitty/shaders.c +++ b/kitty/shaders.c @@ -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; }