diff options
author | Unknown <nyamatongwe@gmail.com> | 2013-04-26 09:12:05 +1000 |
---|---|---|
committer | Unknown <nyamatongwe@gmail.com> | 2013-04-26 09:12:05 +1000 |
commit | f0dff024feb1b16e992a84e9c076a0336fdd0bc6 (patch) | |
tree | 037eab049359968b0da9ede8f67f22d11fcbce59 | |
parent | 4975a96098da2e4f1656b228d89281e80fc67dea (diff) | |
download | scintilla-mirror-f0dff024feb1b16e992a84e9c076a0336fdd0bc6.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(); } |