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

From e8844c138991792a3402e80bf12ebc5dd0e55262 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)

(cherry picked from commit 079cd92d02ed5b2391d9c469ff6d04d4f967b3d9)
---
 src/SDL_ttf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/SDL_ttf.c b/src/SDL_ttf.c
index 6d4c2d3d..2cfe90e2 100644
--- a/src/SDL_ttf.c
+++ b/src/SDL_ttf.c
@@ -2334,6 +2334,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) {
@@ -2366,6 +2368,7 @@ void TTF_RemoveFallbackFont(TTF_Font *font, TTF_Font *fallback)
         }
     }
 
+    Flush_Cache(font);
     UpdateFontText(font, NULL);
 }