Bug 547680 – fontconfig monitoring can crash apps

2008-08-15  Behdad Esfahbod  <behdad@gnome.org>

        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
This commit is contained in:
Behdad Esfahbod 2008-08-15 19:43:20 +00:00 committed by Behdad Esfahbod
parent e8442a52aa
commit a7f6e2c8fb
2 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2008-08-15 Behdad Esfahbod <behdad@gnome.org>
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 <sven@imendio.com>
Use the g_test_*() API for this test

View File

@ -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", &timestamp,
@ -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;