From fd4721ce45cce12723d3a1fde8a635367eb08559 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 28 Feb 2003 19:22:58 +0000 Subject: Fix embed dialog to pass a good EphyEmbed when the initial one has been 2003-02-28 Marco Pesenti Gritti * TODO: * embed/ephy-embed-dialog.c: (unset_embed), (ephy_embed_dialog_finalize), (ephy_embed_dialog_set_embed): * src/ephy-tab.c: (ephy_tab_init), (ephy_tab_destroy_brsr_cb): Fix embed dialog to pass a good EphyEmbed when the initial one has been destroyed --- embed/ephy-embed-dialog.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'embed') 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 @@ -105,6 +105,16 @@ ephy_embed_dialog_init (EphyEmbedDialog *dialog) dialog->priv->embed = NULL; } +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) { @@ -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 * -- cgit