diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2013-04-26 09:12:05 +1000 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2013-04-26 09:12:05 +1000 |
commit | 3f75bffcfb3bfd803cb494d88722e309620598b7 (patch) | |
tree | 1b229eecbb7c12c6046494b28f4f67ac94cd7e6a | |
parent | e4f1a3ce3f091e2405333af2054c7b6e516605b3 (diff) | |
download | scintilla-mirror-3f75bffcfb3bfd803cb494d88722e309620598b7.tar.gz |
Release all cached fonts when finalising.
-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(); } |