aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-02-03 03:27:07 +0800
committerChristian Persch <chpe@src.gnome.org>2005-02-03 03:27:07 +0800
commit2bb88affbb80a7556dfe4d5a0fb194fe4b147c4e (patch)
tree292c658247714609921336918b40f4c02b287f13 /embed
parentb6006aec036e030f33bdbf593164642ed4edd6b8 (diff)
downloadgsoc2013-epiphany-2bb88affbb80a7556dfe4d5a0fb194fe4b147c4e.tar.gz
gsoc2013-epiphany-2bb88affbb80a7556dfe4d5a0fb194fe4b147c4e.tar.zst
gsoc2013-epiphany-2bb88affbb80a7556dfe4d5a0fb194fe4b147c4e.zip
Weak ref the parent window.
2005-02-02 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-embed-persist.c: (ephy_embed_persist_set_fc_parent), (ephy_embed_persist_finalize): Weak ref the parent window.
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed-persist.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/embed/ephy-embed-persist.c b/embed/ephy-embed-persist.c
index 5b02a10cc..92d7a99c8 100644
--- a/embed/ephy-embed-persist.c
+++ b/embed/ephy-embed-persist.c
@@ -154,9 +154,17 @@ void
ephy_embed_persist_set_fc_parent (EphyEmbedPersist *persist,
GtkWindow *value)
{
+ EphyEmbedPersistPrivate *priv;
+ GtkWindow **wptr;
+
g_return_if_fail (EPHY_IS_EMBED_PERSIST (persist));
- persist->priv->fc_parent = value;
+ priv = persist->priv;
+
+ priv->fc_parent = value;
+ wptr = &priv->fc_parent;
+ g_object_add_weak_pointer (G_OBJECT (priv->fc_parent),
+ (gpointer *) wptr);
}
/**
@@ -447,11 +455,20 @@ static void
ephy_embed_persist_finalize (GObject *object)
{
EphyEmbedPersist *persist = EPHY_EMBED_PERSIST (object);
+ EphyEmbedPersistPrivate *priv = persist->priv;
+ GtkWindow **wptr;
+
+ g_free (priv->dest);
+ g_free (priv->source);
+ g_free (priv->fc_title);
+ g_free (priv->persist_key);
- g_free (persist->priv->dest);
- g_free (persist->priv->source);
- g_free (persist->priv->fc_title);
- g_free (persist->priv->persist_key);
+ if (priv->fc_parent != NULL)
+ {
+ wptr = &priv->fc_parent;
+ g_object_remove_weak_pointer (G_OBJECT (priv->fc_parent),
+ (gpointer *) wptr);
+ }
LOG ("EphyEmbedPersist finalised %p", object);