pango r2681 - in trunk: . pango



Author: behdad
Date: Wed Aug  6 08:40:03 2008
New Revision: 2681
URL: http://svn.gnome.org/viewvc/pango?rev=2681&view=rev

Log:
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.

Modified:
   trunk/ChangeLog
   trunk/pango/pangocairo-fontmap.c

Modified: trunk/pango/pangocairo-fontmap.c
==============================================================================
--- trunk/pango/pangocairo-fontmap.c	(original)
+++ trunk/pango/pangocairo-fontmap.c	Wed Aug  6 08:40:03 2008
@@ -187,7 +187,8 @@
  * 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 @@
 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 @@
   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;
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]