[pango] Bug 753167 - Pango script crashes
- From: Behdad Esfahbod <behdad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] Bug 753167 - Pango script crashes
- Date: Tue, 18 Aug 2015 14:56:47 +0000 (UTC)
commit 40e1a245ee95781a4d8eb41ad246a4a733dbfab5
Author: Behdad Esfahbod <behdad behdad org>
Date: Tue Aug 18 15:56:14 2015 +0100
Bug 753167 - Pango script crashes
https://bugzilla.gnome.org/show_bug.cgi?id=753167
pango/pangoft2-fontmap.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c
index ee27f7f..38be00d 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]