[gnome-software/gnome-3-16] sources dialog: Disconnect from "updates-changed" signal handler



commit 8582b5386d5bd55d325ba577441fe435f9ee4a65
Author: Kalev Lember <kalevlember gmail com>
Date:   Fri May 29 23:16:00 2015 +0200

    sources dialog: Disconnect from "updates-changed" signal handler
    
    Disconnect from the signal handler in dispose to make sure we don't get
    callbacks after the dialog is destroyed.

 src/gs-sources-dialog.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-sources-dialog.c b/src/gs-sources-dialog.c
index 573b439..f8b7f1d 100644
--- a/src/gs-sources-dialog.c
+++ b/src/gs-sources-dialog.c
@@ -385,7 +385,10 @@ gs_sources_dialog_dispose (GObject *object)
        GsSourcesDialog *dialog = GS_SOURCES_DIALOG (object);
        GsSourcesDialogPrivate *priv = gs_sources_dialog_get_instance_private (dialog);
 
-       g_clear_object (&priv->plugin_loader);
+       if (priv->plugin_loader != NULL) {
+               g_signal_handlers_disconnect_by_func (priv->plugin_loader, updates_changed_cb, dialog);
+               g_clear_object (&priv->plugin_loader);
+       }
 
        if (priv->cancellable != NULL) {
                g_cancellable_cancel (priv->cancellable);


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