aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-02-16 08:55:53 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-02-16 10:05:33 +0800
commitb55c39cdecd01471c808e7c0e88e8560afa54eab (patch)
treefd7ab718fa04c8d9d0a381b56c86ae6b11040971 /modules
parentda38777cc0f397ff8e3bd8b6500916bd9291f7f9 (diff)
downloadgsoc2013-evolution-b55c39cdecd01471c808e7c0e88e8560afa54eab.tar
gsoc2013-evolution-b55c39cdecd01471c808e7c0e88e8560afa54eab.tar.gz
gsoc2013-evolution-b55c39cdecd01471c808e7c0e88e8560afa54eab.tar.bz2
gsoc2013-evolution-b55c39cdecd01471c808e7c0e88e8560afa54eab.tar.lz
gsoc2013-evolution-b55c39cdecd01471c808e7c0e88e8560afa54eab.tar.xz
gsoc2013-evolution-b55c39cdecd01471c808e7c0e88e8560afa54eab.tar.zst
gsoc2013-evolution-b55c39cdecd01471c808e7c0e88e8560afa54eab.zip
EBookShellView: Keep an ID for "source-removed" signal handler.
Diffstat (limited to 'modules')
-rw-r--r--modules/addressbook/e-book-shell-view-private.c19
-rw-r--r--modules/addressbook/e-book-shell-view-private.h2
2 files changed, 13 insertions, 8 deletions
diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c
index efe4322cd0..82b339596f 100644
--- a/modules/addressbook/e-book-shell-view-private.c
+++ b/modules/addressbook/e-book-shell-view-private.c
@@ -530,6 +530,7 @@ e_book_shell_view_private_constructed (EBookShellView *book_shell_view)
EShellSidebar *shell_sidebar;
EShellBackend *shell_backend;
ESourceSelector *selector;
+ gulong handler_id;
shell_view = E_SHELL_VIEW (book_shell_view);
shell_backend = e_shell_view_get_shell_backend (shell_view);
@@ -553,10 +554,11 @@ e_book_shell_view_private_constructed (EBookShellView *book_shell_view)
selector = e_book_shell_sidebar_get_selector (
E_BOOK_SHELL_SIDEBAR (shell_sidebar));
- g_signal_connect (
+ handler_id = g_signal_connect (
priv->registry, "source-removed",
G_CALLBACK (book_shell_view_source_removed_cb),
book_shell_view);
+ priv->source_removed_handler_id = handler_id;
g_signal_connect_object (
selector, "button-press-event",
@@ -587,17 +589,18 @@ e_book_shell_view_private_dispose (EBookShellView *book_shell_view)
{
EBookShellViewPrivate *priv = book_shell_view->priv;
+ if (priv->source_removed_handler_id > 0) {
+ g_signal_handler_disconnect (
+ priv->registry,
+ priv->source_removed_handler_id);
+ priv->source_removed_handler_id = 0;
+ }
+
g_clear_object (&priv->book_shell_backend);
g_clear_object (&priv->book_shell_content);
g_clear_object (&priv->book_shell_sidebar);
- if (priv->registry != NULL) {
- g_signal_handlers_disconnect_matched (
- priv->registry, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, book_shell_view);
- g_object_unref (priv->registry);
- priv->registry = NULL;
- }
+ g_clear_object (&priv->registry);
g_hash_table_remove_all (priv->uid_to_view);
}
diff --git a/modules/addressbook/e-book-shell-view-private.h b/modules/addressbook/e-book-shell-view-private.h
index 1fe2b9b7a4..108677b790 100644
--- a/modules/addressbook/e-book-shell-view-private.h
+++ b/modules/addressbook/e-book-shell-view-private.h
@@ -85,6 +85,8 @@ struct _EBookShellViewPrivate {
EBookShellSidebar *book_shell_sidebar;
ESourceRegistry *registry;
+ gulong source_removed_handler_id;
+
GHashTable *uid_to_view;
gint preview_index;