[evolution] EBookShellView: Keep an ID for "source-removed" signal handler.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] EBookShellView: Keep an ID for "source-removed" signal handler.
- Date: Sat, 16 Feb 2013 02:06:21 +0000 (UTC)
commit b55c39cdecd01471c808e7c0e88e8560afa54eab
Author: Matthew Barnes <mbarnes redhat com>
Date: Fri Feb 15 19:55:53 2013 -0500
EBookShellView: Keep an ID for "source-removed" signal handler.
modules/addressbook/e-book-shell-view-private.c | 19 +++++++++++--------
modules/addressbook/e-book-shell-view-private.h | 2 ++
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 efe4322..82b3395 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 1fe2b9b..108677b 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]