summaryrefslogtreecommitdiff
path: root/pango/pangoft2-fontmap.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-06-21 15:32:22 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-06-21 15:32:22 +0000
commitffc0b21393fcfb8be247afe7ad32291ab4431d4a (patch)
tree8dc2ad7b0798249688419efec01dfbe8c21d99d9 /pango/pangoft2-fontmap.c
parent329566a3e3af0cfebdb561978e6622ebe8208108 (diff)
downloadpango-ffc0b21393fcfb8be247afe7ad32291ab4431d4a.tar.gz
For cleanliness, unref the fontmap if we get an error from FreeType.
Mon Jun 21 11:29:39 2004 Owen Taylor <otaylor@redhat.com> * pango/pangoft2-fontmap.c (pango_ft2_font_map_new): For cleanliness, unref the fontmap if we get an error from FreeType. (#143524, Morten Welinder) * pango/pangoft2-fontmap.c (pango_ft2_font_map_finalize): Deal with NULL ft2fontmap->library.
Diffstat (limited to 'pango/pangoft2-fontmap.c')
-rw-r--r--pango/pangoft2-fontmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c
index 3460eee8..6bc1936c 100644
--- a/pango/pangoft2-fontmap.c
+++ b/pango/pangoft2-fontmap.c
@@ -136,7 +136,8 @@ pango_ft2_font_map_finalize (GObject *object)
if (ft2fontmap->substitute_destroy)
ft2fontmap->substitute_destroy (ft2fontmap->substitute_data);
- FT_Done_FreeType (ft2fontmap->library);
+ if (ft2fontmap->library)
+ FT_Done_FreeType (ft2fontmap->library);
parent_class->finalize (object);
}
@@ -171,6 +172,7 @@ pango_ft2_font_map_new (void)
{
g_warning ("Error from FT_Init_FreeType: %s",
_pango_ft2_ft_strerror (error));
+ g_object_unref (ft2fontmap);
return NULL;
}