aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-03-01 03:22:58 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-03-01 03:22:58 +0800
commitfd4721ce45cce12723d3a1fde8a635367eb08559 (patch)
treea8ad5e0e1cd18cb6babc0250e2b14af2694b704e /embed
parent30268048c1a62294bfe663d95830eeffb594aaf4 (diff)
downloadgsoc2013-epiphany-fd4721ce45cce12723d3a1fde8a635367eb08559.tar
gsoc2013-epiphany-fd4721ce45cce12723d3a1fde8a635367eb08559.tar.gz
gsoc2013-epiphany-fd4721ce45cce12723d3a1fde8a635367eb08559.tar.bz2
gsoc2013-epiphany-fd4721ce45cce12723d3a1fde8a635367eb08559.tar.lz
gsoc2013-epiphany-fd4721ce45cce12723d3a1fde8a635367eb08559.tar.xz
gsoc2013-epiphany-fd4721ce45cce12723d3a1fde8a635367eb08559.tar.zst
gsoc2013-epiphany-fd4721ce45cce12723d3a1fde8a635367eb08559.zip
Fix embed dialog to pass a good EphyEmbed when the initial one has been
2003-02-28 Marco Pesenti Gritti <marco@it.gnome.org> * 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
Diffstat (limited to 'embed')
-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 *