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



commit bd64dab39038983a05e0407bba00c7906bb10c01
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 e486933..878776f 100644
--- a/src/gs-update-monitor.c
+++ b/src/gs-update-monitor.c
@@ -617,6 +617,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]