aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 1f58e3bb3..8195b3135 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -332,13 +332,29 @@ ephy_window_get_type (void)
}
static void
+remove_from_session (EphyWindow *window)
+{
+ Session *session;
+
+ session = SESSION (ephy_shell_get_session (ephy_shell));
+ g_return_if_fail (session != NULL);
+
+ session_remove_window (session, window);
+}
+
+static void
ephy_window_destroy (GtkObject *gtkobject)
{
EphyWindow *window = EPHY_WINDOW (gtkobject);
LOG ("EphyWindow destroy %p", window)
- window->priv->closing = TRUE;
+ if (window->priv->closing == FALSE)
+ {
+ window->priv->closing = TRUE;
+
+ remove_from_session (window);
+ }
if (window->priv->exit_fullscreen_popup)
{
@@ -1435,17 +1451,6 @@ save_window_chrome (EphyWindow *window)
}
static void
-remove_from_session (EphyWindow *window)
-{
- Session *session;
-
- session = SESSION (ephy_shell_get_session (ephy_shell));
- g_return_if_fail (session != NULL);
-
- session_remove_window (session, window);
-}
-
-static void
ephy_window_finalize (GObject *object)
{
EphyWindow *window;
@@ -1456,8 +1461,6 @@ ephy_window_finalize (GObject *object)
g_return_if_fail (window->priv != NULL);
- remove_from_session (window);
-
if (window->priv->find_dialog)
{
g_object_unref (G_OBJECT (window->priv->find_dialog));