summaryrefslogtreecommitdiff
path: root/pango/pangocairo-fontmap.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2008-08-06 08:40:03 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2008-08-06 08:40:03 +0000
commita29377c7a5ceffc53a2a651faa2d099701b4e53e (patch)
tree5007bc598aa739f8b692bb34cc60909e69b29205 /pango/pangocairo-fontmap.c
parente77df055f63ed72278684ac6c426af4f74114fc0 (diff)
downloadpango-a29377c7a5ceffc53a2a651faa2d099701b4e53e.tar.gz
Bug 546534 – pango_cairo_font_map_set_default(NULL) errs
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. svn path=/trunk/; revision=2681
Diffstat (limited to 'pango/pangocairo-fontmap.c')
-rw-r--r--pango/pangocairo-fontmap.c9
1 files changed, 6 insertions, 3 deletions
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;
}
/**