diff options
-rw-r--r-- | gtk/PlatGTK.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index c228047c6..d244b2525 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -259,6 +259,7 @@ class FontCached : Font { public: static FontID FindOrCreate(const FontParameters &fp); static void ReleaseId(FontID fid_); + static void ReleaseAll(); }; FontCached *FontCached::first = 0; @@ -328,6 +329,12 @@ void FontCached::ReleaseId(FontID fid_) { FontMutexUnlock(); } +void FontCached::ReleaseAll() { + while (first) { + ReleaseId(first->GetID()); + } +} + FontID FontCached::CreateNewFont(const FontParameters &fp) { PangoFontDescription *pfd = pango_font_description_new(); if (pfd) { @@ -2165,5 +2172,6 @@ void Platform_Initialise() { } void Platform_Finalise() { + FontCached::ReleaseAll(); FontMutexFree(); } |