[gnome-software/wip/rancell/ubuntu-3-20-3: 31/32] update monitor: Fix a possible crash when download-updates setting is changed



commit 050736442302ba2f3ce0348214879787c8367100
Author: Kalev Lember <klember redhat com>
Date:   Tue Jul 5 12:36:59 2016 +0200

    update monitor: Fix a possible crash when download-updates setting is changed
    
    Make sure to disconnect the updates-changed signal handler so that we
    don't get the callback after the update monitor has been destroyed.
    
    May fix https://bugzilla.redhat.com/show_bug.cgi?id=1320307

 src/gs-update-monitor.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-update-monitor.c b/src/gs-update-monitor.c
index b1a515e..6a23153 100644
--- a/src/gs-update-monitor.c
+++ b/src/gs-update-monitor.c
@@ -608,6 +608,12 @@ gs_update_monitor_dispose (GObject *object)
                                                      monitor);
                monitor->network_monitor = NULL;
        }
+       if (monitor->plugin_loader != NULL) {
+               g_signal_handlers_disconnect_by_func (monitor->plugin_loader,
+                                                     updates_changed_cb,
+                                                     monitor);
+               monitor->plugin_loader = NULL;
+       }
        g_clear_object (&monitor->settings);
 
        G_OBJECT_CLASS (gs_update_monitor_parent_class)->dispose (object);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]