aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ChangeLog10
-rw-r--r--TODO2
-rw-r--r--embed/ephy-embed-dialog.c17
-rw-r--r--src/ephy-tab.c5
4 files changed, 32 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3b843c285..29c70e13f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
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
+
+2003-02-28 Marco Pesenti Gritti <marco@it.gnome.org>
+
* data/glade/Makefile.am:
* data/glade/toolbar-editor.glade:
diff --git a/TODO b/TODO
index 15614a0e8..fd3595391 100644
--- a/TODO
+++ b/TODO
@@ -1,7 +1,6 @@
To do:
- make popups less annoying
-- embed dialogs crashes when the window has been closed
- show when bookmarks has updated content
- temporary bookmarks, maybe an expire checkbox in new bookmark dialog ? (I could be on crack here, would be nice to find a good solution though)
@@ -30,3 +29,4 @@ Done:
* titles in history for hosts too
* history shows empty hosts sometimes !?
* save bookmarks dialog state (current keyword)
+* embed dialogs crashes when the window has been closed
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 *
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 8a0c20863..fa7756369 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -194,6 +194,8 @@ ephy_tab_init (EphyTab *tab)
tab->priv = g_new0 (EphyTabPrivate, 1);
tab->priv->embed = ephy_embed_new (G_OBJECT(single));
+ ephy_embed_shell_add_embed (EPHY_EMBED_SHELL (ephy_shell),
+ tab->priv->embed);
tab->priv->window = NULL;
tab->priv->event = NULL;
@@ -768,6 +770,9 @@ ephy_tab_destroy_brsr_cb (EphyEmbed *embed, EphyTab *tab)
window = ephy_tab_get_window (tab);
ephy_window_remove_tab (window, tab);
+
+ ephy_embed_shell_remove_embed (EPHY_EMBED_SHELL (ephy_shell),
+ tab->priv->embed);
}
static gint