SDL_ttf: Flush cache when removing a fallback font (fix #549)

From 079cd92d02ed5b2391d9c469ff6d04d4f967b3d9 Mon Sep 17 00:00:00 2001
From: Void Star Caster <[EMAIL REDACTED]>
Date: Fri, 23 Jan 2026 12:10:59 +0100
Subject: [PATCH] Flush cache when removing a fallback font (fix #549)

---
 src/SDL_ttf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/SDL_ttf.c b/src/SDL_ttf.c
index 79ebffa1..353652c7 100644
--- a/src/SDL_ttf.c
+++ b/src/SDL_ttf.c
@@ -2332,6 +2332,8 @@ bool TTF_AddFallbackFont(TTF_Font *font, TTF_Font *fallback)
     return true;
 }
 
+static void Flush_Cache(TTF_Font *font);
+
 void TTF_RemoveFallbackFont(TTF_Font *font, TTF_Font *fallback)
 {
     if (!font || !fallback) {
@@ -2364,6 +2366,7 @@ void TTF_RemoveFallbackFont(TTF_Font *font, TTF_Font *fallback)
         }
     }
 
+    Flush_Cache(font);
     UpdateFontText(font, NULL);
 }