diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | pango/pangocairo-fontmap.c | 9 |
2 files changed, 13 insertions, 3 deletions
@@ -1,5 +1,12 @@ 2008-08-06 Behdad Esfahbod <behdad@gnome.org> + Bug 546534 – pango_cairo_font_map_set_default(NULL) errs + + * pango/pangocairo-fontmap.c (pango_cairo_font_map_set_default): + Allow NULL. + +2008-08-06 Behdad Esfahbod <behdad@gnome.org> + Bug 431394 – Use pango_glyph_item_iter in more places * pango/glyphstring.c (pango_glyph_string_get_logical_widths): diff --git a/pango/pangocairo-fontmap.c b/pango/pangocairo-fontmap.c index 1661c88b..11f663da 100644 --- a/pango/pangocairo-fontmap.c +++ b/pango/pangocairo-fontmap.c @@ -187,7 +187,8 @@ pango_cairo_font_map_get_default (void) * default fontmap uses for example. The old default font map * is unreffed and the new font map referenced. * - * A value of %NULL for @fontmap will cause a new default font + * A value of %NULL for @fontmap will cause the current default + * font map to be released and a new default font * map to be created on demand, using pango_cairo_font_map_new(). * * Since: 1.22 @@ -195,7 +196,7 @@ pango_cairo_font_map_get_default (void) void pango_cairo_font_map_set_default (PangoCairoFontMap *fontmap) { - g_return_if_fail (PANGO_IS_CAIRO_FONT_MAP (fontmap)); + g_return_if_fail (fontmap == NULL || PANGO_IS_CAIRO_FONT_MAP (fontmap)); if ((PangoFontMap *) fontmap == default_font_map) return; @@ -203,7 +204,9 @@ pango_cairo_font_map_set_default (PangoCairoFontMap *fontmap) if (default_font_map) g_object_unref (default_font_map); - default_font_map = g_object_ref (fontmap); + if (fontmap) + g_object_ref (fontmap); + default_font_map = fontmap; } /** |