From 554a4d4f486f0e96307591c041561c60751f3d33 Mon Sep 17 00:00:00 2001 From: takase1121 <20792268+takase1121@users.noreply.github.com> Date: Tue, 16 May 2023 21:18:04 +0800 Subject: [PATCH] fix(renderer): fix memory leak when freeing glyphsets --- src/renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer.c b/src/renderer.c index 8b1bd4f0..2cf854ce 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -203,7 +203,7 @@ static RenFont* font_group_get_glyph(GlyphSet** set, GlyphMetric** metric, RenFo static void font_clear_glyph_cache(RenFont* font) { for (int i = 0; i < SUBPIXEL_BITMAPS_CACHED; ++i) { - for (int j = 0; j < MAX_GLYPHSET; ++j) { + for (int j = 0; j < MAX_LOADABLE_GLYPHSETS; ++j) { if (font->sets[i][j]) { if (font->sets[i][j]->surface) SDL_FreeSurface(font->sets[i][j]->surface);