[gnome-todo] manager: remove old signals on provider-removal
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] manager: remove old signals on provider-removal
- Date: Tue, 23 May 2017 01:48:13 +0000 (UTC)
commit 1c447295f0ef18e9e58028a690babfe1b4c490f8
Author: Rohit Kaushik <kaushikrohit325 gmail com>
Date: Fri May 19 18:54:46 2017 +0530
manager: remove old signals on provider-removal
Currently, the signals connected to providers are not disconnected
after the provider is removed.It doesn't cause any problem with
providers which are built-in but with providers that work as a plugin
e.g Todo.txt this would cause weird behaviour.
Removing all handlers on the signals that were connected initially,
solves the problem.
https://bugzilla.gnome.org/show_bug.cgi?id=781079
src/engine/gtd-manager.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/engine/gtd-manager.c b/src/engine/gtd-manager.c
index 79b5f51..8f63d77 100644
--- a/src/engine/gtd-manager.c
+++ b/src/engine/gtd-manager.c
@@ -568,10 +568,24 @@ gtd_manager__provider_removed (GtdPluginManager *plugin_manager,
for (l = lists; l != NULL; l = l->next)
gtd_manager__list_removed (provider, l->data, self);
+ /* Disconnect old signals */
+
g_signal_handlers_disconnect_by_func (provider,
gtd_manager__default_list_changed_cb,
self);
+ g_signal_handlers_disconnect_by_func (provider,
+ gtd_manager__list_added,
+ self);
+
+ g_signal_handlers_disconnect_by_func (provider,
+ gtd_manager__list_changed,
+ self);
+
+ g_signal_handlers_disconnect_by_func (provider,
+ gtd_manager__list_removed,
+ self);
+
g_signal_emit (self, signals[PROVIDER_REMOVED], 0, provider);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]