From 6a9df196108b4a27ec27a35e948dc5566f6bd8c6 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Thu, 11 Nov 2004 17:57:51 +0000 Subject: Keep a ref on EphyShell in ephy_session_close(). Otherwise we get a crash 2004-11-11 Christian Persch * src/ephy-session.c: (ephy_session_close): Keep a ref on EphyShell in ephy_session_close(). Otherwise we get a crash when the session manager sends us the "die" signal, and we don't have a tool window (bme, history) open. --- src/ephy-session.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ephy-session.c') diff --git a/src/ephy-session.c b/src/ephy-session.c index 365cdc4be..bff2a1330 100644 --- a/src/ephy-session.c +++ b/src/ephy-session.c @@ -480,6 +480,11 @@ ephy_session_close (EphySession *session) LOG ("ephy_session_close") + /* we have to ref the shell or else we may get finalised between + * destroying the windows and destroying the tool windows + */ + g_object_ref (ephy_shell); + windows = ephy_session_get_windows (session); g_list_foreach (windows, (GFunc) gtk_widget_destroy, NULL); g_list_free (windows); @@ -487,6 +492,8 @@ ephy_session_close (EphySession *session) windows = g_list_copy (session->priv->tool_windows); g_list_foreach (windows, (GFunc) gtk_widget_destroy, NULL); g_list_free (windows); + + g_object_unref (ephy_shell); } static int -- cgit v1.2.3