[pango] Bug 589133 – Firefox 3.5 complains about invalid weak references
- From: Behdad Esfahbod <behdad src gnome org>
- To: svn-commits-list gnome org
- Subject: [pango] Bug 589133 – Firefox 3.5 complains about invalid weak references
- Date: Mon, 20 Jul 2009 20:51:01 +0000 (UTC)
commit 1eadda908f0f9262dcb4c301f487b5a190dc0e54
Author: Behdad Esfahbod <behdad behdad org>
Date: Mon Jul 20 16:49:16 2009 -0400
Bug 589133 â?? Firefox 3.5 complains about invalid weak references
pango/pangofc-font.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index 1b210cd..8fc5a57 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -45,6 +45,7 @@ struct _PangoFcFontPrivate
PangoFcDecoder *decoder;
PangoFcFontKey *key;
PangoFcCmapCache *cmap_cache;
+ gboolean has_weak_pointer; /* have set a weak_pointer from fontmap to us */
};
static gboolean pango_fc_font_real_has_char (PangoFcFont *font,
@@ -142,7 +143,11 @@ pango_fc_font_finalize (GObject *object)
if (fcfont->fontmap)
{
_pango_fc_font_map_remove (PANGO_FC_FONT_MAP (fcfont->fontmap), fcfont);
- g_object_remove_weak_pointer (G_OBJECT (fcfont->fontmap), (gpointer *) (gpointer) &fcfont->fontmap);
+ if (priv->has_weak_pointer)
+ {
+ priv->has_weak_pointer = FALSE;
+ g_object_remove_weak_pointer (G_OBJECT (fcfont->fontmap), (gpointer *) (gpointer) &fcfont->fontmap);
+ }
fcfont->fontmap = NULL;
}
@@ -224,7 +229,11 @@ pango_fc_font_set_property (GObject *object,
g_return_if_fail (fcfont->fontmap == NULL);
fcfont->fontmap = (PangoFontMap *) fcfontmap;
if (fcfont->fontmap)
- g_object_add_weak_pointer (G_OBJECT (fcfont->fontmap), (gpointer *) (gpointer) &fcfont->fontmap);
+ {
+ PangoFcFontPrivate *priv = fcfont->priv;
+ priv->has_weak_pointer = TRUE;
+ g_object_add_weak_pointer (G_OBJECT (fcfont->fontmap), (gpointer *) (gpointer) &fcfont->fontmap);
+ }
}
goto set_decoder;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]