[gnome-todo/gnome-3-24] 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/gnome-3-24] manager: remove old signals on provider-removal
- Date: Wed, 24 May 2017 22:26:42 +0000 (UTC)
commit 0e8f708271ec76a40b445bef50241d8a60d2d261
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 fe0dca1..ce6e252 100644
--- a/src/engine/gtd-manager.c
+++ b/src/engine/gtd-manager.c
@@ -560,10 +560,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]