pango r2784 - in trunk: . pango
- From: behdad svn gnome org
- To: svn-commits-list gnome org
- Subject: pango r2784 - in trunk: . pango
- Date: Tue, 6 Jan 2009 09:52:00 +0000 (UTC)
Author: behdad
Date: Tue Jan 6 09:52:00 2009
New Revision: 2784
URL: http://svn.gnome.org/viewvc/pango?rev=2784&view=rev
Log:
2009-01-06 Behdad Esfahbod <behdad gnome org>
Bug 166676 â pango_fc_font_map_finalize
* pango/pangofc-fontmap.c (pango_fc_font_map_finalize),
(pango_fc_face_describe), (pango_fc_face_list_sizes),
(pango_fc_face_finalize), (pango_fc_face_class_init),
(pango_fc_family_list_faces), (pango_fc_family_finalize),
(pango_fc_family_class_init):
Finalize families and faces.
Modified:
trunk/ChangeLog
trunk/pango/pangofc-fontmap.c
Modified: trunk/pango/pangofc-fontmap.c
==============================================================================
--- trunk/pango/pangofc-fontmap.c (original)
+++ trunk/pango/pangofc-fontmap.c Tue Jan 6 09:52:00 2009
@@ -483,7 +483,7 @@
{
PangoFcFontMap *fcfontmap = PANGO_FC_FONT_MAP (object);
PangoFcFontMapPrivate *priv = fcfontmap->priv;
-
+ int i;
/* Shutdown, so we clear the fonts and mark them as shut down */
pango_fc_font_map_shutdown (fcfontmap);
@@ -505,6 +505,13 @@
priv->findfuncs = g_slist_delete_link (priv->findfuncs, priv->findfuncs);
}
+ for (i = 0; i < priv->n_families; i++)
+ {
+ priv->families[i]->fontmap = NULL;
+ g_object_unref (priv->families[i]);
+ }
+ g_free (priv->families);
+
G_OBJECT_CLASS (pango_fc_font_map_parent_class)->finalize (object);
}
@@ -1642,6 +1649,8 @@
* PangoFcFace
*/
+static GObjectClass *pango_fc_face_parent_class = NULL;
+
static PangoFontDescription *
make_alias_description (PangoFcFamily *fcfamily,
gboolean bold,
@@ -1666,6 +1675,8 @@
FcPattern *match_pattern;
FcPattern *result_pattern;
+ g_return_val_if_fail (fcfamily != NULL, NULL);
+
if (fcface->fake)
{
if (strcmp (fcface->style, "Regular") == 0)
@@ -1733,6 +1744,11 @@
FcFontSet *fontset;
FcObjectSet *objectset;
+ *sizes = NULL;
+ *n_sizes = 0;
+ g_return_if_fail (fcface->family != NULL);
+ g_return_if_fail (fcface->family->fontmap != NULL);
+
pattern = FcPatternCreate ();
FcPatternAddString (pattern, FC_FAMILY, (FcChar8*)(void*)fcface->family->family_name);
FcPatternAddString (pattern, FC_STYLE, (FcChar8*)(void*)fcface->style);
@@ -1805,8 +1821,23 @@
}
static void
+pango_fc_face_finalize (GObject *object)
+{
+ PangoFcFace *fcface = PANGO_FC_FACE (object);
+
+ g_free (fcface->style);
+
+ pango_fc_face_parent_class->finalize (object);
+}
+
+static void
pango_fc_face_class_init (PangoFontFaceClass *class)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+
+ pango_fc_face_parent_class = g_type_class_peek_parent (class);
+ object_class->finalize = pango_fc_face_finalize;
+
class->describe = pango_fc_face_describe;
class->get_face_name = pango_fc_face_get_face_name;
class->list_sizes = pango_fc_face_list_sizes;
@@ -1845,6 +1876,9 @@
/*
* PangoFcFamily
*/
+
+static GObjectClass *pango_fc_family_parent_class = NULL;
+
static PangoFcFace *
create_face (PangoFcFamily *fcfamily,
const char *style,
@@ -1865,7 +1899,13 @@
{
PangoFcFamily *fcfamily = PANGO_FC_FAMILY (family);
PangoFcFontMap *fcfontmap = fcfamily->fontmap;
- PangoFcFontMapPrivate *priv = fcfontmap->priv;
+ PangoFcFontMapPrivate *priv;
+
+ *faces = NULL;
+ *n_faces = 0;
+ g_return_if_fail (fcfontmap != NULL);
+
+ priv = fcfontmap->priv;
if (fcfamily->n_faces < 0)
{
@@ -2003,8 +2043,31 @@
}
static void
+pango_fc_family_finalize (GObject *object)
+{
+ int i;
+ PangoFcFamily *fcfamily = PANGO_FC_FAMILY (object);
+
+ g_free (fcfamily->family_name);
+
+ for (i = 0; i < fcfamily->n_faces; i++)
+ {
+ fcfamily->faces[i]->family = NULL;
+ g_object_unref (fcfamily->faces[i]);
+ }
+ g_free (fcfamily->faces);
+
+ pango_fc_family_parent_class->finalize (object);
+}
+
+static void
pango_fc_family_class_init (PangoFontFamilyClass *class)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+
+ pango_fc_family_parent_class = g_type_class_peek_parent (class);
+ object_class->finalize = pango_fc_family_finalize;
+
class->list_faces = pango_fc_family_list_faces;
class->get_name = pango_fc_family_get_name;
class->is_monospace = pango_fc_family_is_monospace;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]