aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/e-shell-window.c')
-rw-r--r--shell/e-shell-window.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index 3272b524e7..82727fecdd 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -153,7 +153,12 @@ shell_window_set_shell (EShellWindow *shell_window,
gulong handler_id;
g_return_if_fail (shell_window->priv->shell == NULL);
- shell_window->priv->shell = g_object_ref (shell);
+
+ shell_window->priv->shell = shell;
+
+ g_object_add_weak_pointer (
+ G_OBJECT (shell_window),
+ &shell_window->priv->shell);
/* Need to disconnect these when the window is closing. */
@@ -435,7 +440,7 @@ e_shell_window_get_shell (EShellWindow *shell_window)
{
g_return_val_if_fail (E_IS_SHELL_WINDOW (shell_window), NULL);
- return shell_window->priv->shell;
+ return E_SHELL (shell_window->priv->shell);
}
/**