From a7f6e2c8fbb18f8bb8cfdba5c013d04738219246 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 15 Aug 2008 19:43:20 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20547680=20=E2=80=93=20fontconfig=20monitor?= =?UTF-8?q?ing=20can=20crash=20apps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-08-15 Behdad Esfahbod Bug 547680 – fontconfig monitoring can crash apps * gtk/gtksettings.c (settings_update_fontconfig): Clear pango cache before recreating fontconfig config. svn path=/trunk/; revision=21134 --- ChangeLog | 7 +++++++ gtk/gtksettings.c | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc69953796..c9842a07fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-08-15 Behdad Esfahbod + + Bug 547680 – fontconfig monitoring can crash apps + + * gtk/gtksettings.c (settings_update_fontconfig): Clear pango cache + before recreating fontconfig config. + 2008-08-15 Sven Herzberg Use the g_test_*() API for this test diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index 3fd7f8cf4f..32e783944d 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -2090,7 +2090,7 @@ settings_update_fontconfig (GtkSettings *settings) static guint last_update_timestamp; static gboolean last_update_needed; - gint timestamp; + guint timestamp; g_object_get (settings, "gtk-fontconfig-timestamp", ×tamp, @@ -2105,11 +2105,12 @@ settings_update_fontconfig (GtkSettings *settings) PangoFontMap *fontmap = pango_cairo_font_map_get_default (); gboolean update_needed = FALSE; - if (PANGO_IS_FC_FONT_MAP (fontmap) && - !FcConfigUptoDate (NULL) && FcInitReinitialize ()) + /* bug 547680 */ + if (PANGO_IS_FC_FONT_MAP (fontmap) && !FcConfigUptoDate (NULL)) { - update_needed = TRUE; pango_fc_font_map_cache_clear (PANGO_FC_FONT_MAP (fontmap)); + if (FcInitReinitialize ()) + update_needed = TRUE; } last_update_timestamp = timestamp;