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



commit 205ca84a8e16f67bb718af50d3dcf4c71e45a8a6
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 7fa5e7d..dc7d8ca 100644
--- a/src/gs-update-monitor.c
+++ b/src/gs-update-monitor.c
@@ -610,6 +610,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]