From 4b2d6b0b8b33720095be83c2604248b9940e9be5 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 16 Jun 2003 22:57:51 +0000 Subject: Ref the child before removing it, and unref it after emitting the 2003-06-16 Christian Persch * src/ephy-notebook.c: (ephy_notebook_remove_page): Ref the child before removing it, and unref it after emitting the tabs_removed signal. That way it stays alive while the signal is being processed. Fixes bug 115306. --- ChangeLog | 8 ++++++++ src/ephy-notebook.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a1235233..bd64bd3ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-06-16 Christian Persch + + * src/ephy-notebook.c: (ephy_notebook_remove_page): + + Ref the child before removing it, and unref it after emitting the + tabs_removed signal. That way it stays alive while the signal is + being processed. Fixes bug 115306. + 2003-06-16 Christian Persch * configure.in: diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index 878807e14..6671ee3b3 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -1075,10 +1075,17 @@ ephy_notebook_remove_page (EphyNotebook *nb, g_signal_handlers_disconnect_by_func (label, G_CALLBACK (sync_load_status), tab); - - g_signal_emit (G_OBJECT (nb), signals[TAB_REMOVED], 0, child); + /** + * we ref the child so that it's still alive while the tabs_removed + * signal is processed. + */ + g_object_ref (child); gtk_notebook_remove_page (GTK_NOTEBOOK (nb), position); update_tabs_visibility (nb, FALSE); + + g_signal_emit (G_OBJECT (nb), signals[TAB_REMOVED], 0, child); + + g_object_unref (child); } -- cgit v1.2.3