diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-09-04 04:34:07 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-09-04 04:34:07 +0800 |
commit | 5493a2373b76e9eee14662a41a16ebb7615be6da (patch) | |
tree | 0ce4c9048edd010c2e85b2a3c3769d3a7b3f91d6 | |
parent | 643db1689446521b73c589ef61c82c9536f24f46 (diff) | |
download | gsoc2013-evolution-5493a2373b76e9eee14662a41a16ebb7615be6da.tar.gz gsoc2013-evolution-5493a2373b76e9eee14662a41a16ebb7615be6da.tar.zst gsoc2013-evolution-5493a2373b76e9eee14662a41a16ebb7615be6da.zip |
Fix a reference counting issue in EShellTaskbar.
-rw-r--r-- | shell/e-shell-taskbar.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c index 61f27fbc79..c3d89d7023 100644 --- a/shell/e-shell-taskbar.c +++ b/shell/e-shell-taskbar.c @@ -33,6 +33,10 @@ struct _EShellTaskbarPrivate { gpointer shell_view; /* weak pointer */ + /* Keep a reference to the shell backend since + * we connect to its "activity-added" signal. */ + EShellBackend *shell_backend; + GtkWidget *label; GtkWidget *hbox; @@ -166,6 +170,14 @@ shell_taskbar_dispose (GObject *object) priv->shell_view = NULL; } + if (priv->shell_backend != NULL) { + g_signal_handlers_disconnect_matched ( + priv->shell_backend, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, object); + g_object_unref (priv->shell_backend); + priv->shell_backend = NULL; + } + if (priv->label != NULL) { g_object_unref (priv->label); priv->label = NULL; @@ -206,6 +218,10 @@ shell_taskbar_constructed (GObject *object) shell_view = e_shell_taskbar_get_shell_view (shell_taskbar); shell_backend = e_shell_view_get_shell_backend (shell_view); + /* Keep a reference to the shell backend so we can + * disconnect the signal handler during dispose(). */ + shell_taskbar->priv->shell_backend = g_object_ref (shell_backend); + g_signal_connect_swapped ( shell_backend, "activity-added", G_CALLBACK (shell_taskbar_activity_add), shell_taskbar); |