aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-embed-dialog.c
diff options
context:
space:
mode:
Diffstat (limited to 'embed/ephy-embed-dialog.c')
-rw-r--r--embed/ephy-embed-dialog.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/embed/ephy-embed-dialog.c b/embed/ephy-embed-dialog.c
index cc019253a..7dbdcb215 100644
--- a/embed/ephy-embed-dialog.c
+++ b/embed/ephy-embed-dialog.c
@@ -106,6 +106,16 @@ ephy_embed_dialog_init (EphyEmbedDialog *dialog)
}
static void
+unset_embed (EphyEmbedDialog *dialog)
+{
+ if (dialog->priv->embed != NULL)
+ {
+ g_object_remove_weak_pointer (G_OBJECT (dialog->priv->embed),
+ (gpointer *)&dialog->priv->embed);
+ }
+}
+
+static void
ephy_embed_dialog_finalize (GObject *object)
{
EphyEmbedDialog *dialog;
@@ -117,6 +127,8 @@ ephy_embed_dialog_finalize (GObject *object)
g_return_if_fail (dialog->priv != NULL);
+ unset_embed (dialog);
+
g_free (dialog->priv);
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -175,9 +187,12 @@ ephy_embed_dialog_new_with_parent (GtkWidget *parent_window,
void
ephy_embed_dialog_set_embed (EphyEmbedDialog *dialog,
- EphyEmbed *embed)
+ EphyEmbed *embed)
{
+ unset_embed (dialog);
dialog->priv->embed = embed;
+ g_object_add_weak_pointer (G_OBJECT (dialog->priv->embed),
+ (gpointer *)&dialog->priv->embed);
}
EphyEmbed *