summaryrefslogtreecommitdiff
path: root/pango/pangoft2-fontmap.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2015-08-18 15:56:14 +0100
committerBehdad Esfahbod <behdad@behdad.org>2015-08-18 15:56:14 +0100
commit40e1a245ee95781a4d8eb41ad246a4a733dbfab5 (patch)
tree79ffd3b0643beb9806cd956767b4ffec7ac5419c /pango/pangoft2-fontmap.c
parent3ea523f9da45c68eeab29d2d98f6a1972d0f2682 (diff)
downloadpango-40e1a245ee95781a4d8eb41ad246a4a733dbfab5.tar.gz
Bug 753167 - Pango script crashes
https://bugzilla.gnome.org/show_bug.cgi?id=753167
Diffstat (limited to 'pango/pangoft2-fontmap.c')
-rw-r--r--pango/pangoft2-fontmap.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c
index ee27f7f1..38be00d0 100644
--- a/pango/pangoft2-fontmap.c
+++ b/pango/pangoft2-fontmap.c
@@ -97,10 +97,16 @@ pango_ft2_font_map_class_init (PangoFT2FontMapClass *class)
static void
pango_ft2_font_map_init (PangoFT2FontMap *fontmap)
{
+ FT_Error error;
+
fontmap->serial = 1;
fontmap->library = NULL;
fontmap->dpi_x = 72.0;
fontmap->dpi_y = 72.0;
+
+ error = FT_Init_FreeType (&fontmap->library);
+ if (error != FT_Err_Ok)
+ g_critical ("pango_ft2_font_map_init: Could not initialize freetype");
}
static void
@@ -136,21 +142,12 @@ pango_ft2_font_map_finalize (GObject *object)
PangoFontMap *
pango_ft2_font_map_new (void)
{
- PangoFT2FontMap *ft2fontmap;
- FT_Error error;
-
#if !GLIB_CHECK_VERSION (2, 35, 3)
/* Make sure that the type system is initialized */
g_type_init ();
#endif
- ft2fontmap = g_object_new (PANGO_TYPE_FT2_FONT_MAP, NULL);
-
- error = FT_Init_FreeType (&ft2fontmap->library);
- if (error != FT_Err_Ok)
- g_critical ("pango_ft2_font_map_new: Could not initialize freetype");
-
- return (PangoFontMap *)ft2fontmap;
+ return (PangoFontMap *) g_object_new (PANGO_TYPE_FT2_FONT_MAP, NULL);
}
static guint