From 7404070d5e5d349ab5d224c58cc86fd8a8f2aa33 Mon Sep 17 00:00:00 2001 From: Liu Date: Fri, 20 Nov 2026 00:15:26 +0800 Subject: [PATCH] fix(pandagl): release fontconfig global caches on shutdown FcInitLoadConfigAndFonts() leaves fontconfig global configuration and caches allocated; FcConfigDestroy() only releases the per-call config. Call FcFini() when the font library is destroyed. --- lib/pandagl/src/font/library.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/pandagl/src/font/library.c b/lib/pandagl/src/font/library.c index c4280249..07f33178 100644 --- a/lib/pandagl/src/font/library.c +++ b/lib/pandagl/src/font/library.c @@ -916,6 +916,11 @@ static void pd_font_library_destroy_engine(void) #ifdef PANDAGL_HAS_FREETYPE pd_freetype_engine_destroy(); #endif +#ifdef PANDAGL_HAS_FONTCONFIG + /* FcInitLoadConfigAndFonts() also populates fontconfig's global + * caches; FcConfigDestroy() only releases the per-call config. */ + FcFini(); +#endif } void pd_font_library_init(void)