From 37b68030942fd670c83c2ba42fd656a3cb0d9284 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 e9e715ef..6d14ea44 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);