[gnome-settings-daemon] Disconnect signals from UpClient before unref'ing because it may survive the unref call.



commit cd1ae5a86a073c475724e161ec7d693fb7364dc8
Author: Michael Terry <michael terry canonical com>
Date:   Mon Apr 9 12:50:02 2012 -0400

    Disconnect signals from UpClient before unref'ing because it may survive the unref call.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673007
    
    Signed-off-by: Richard Hughes <richard hughsie com>

 plugins/power/gsd-power-manager.c     |    2 ++
 plugins/updates/gsd-updates-refresh.c |    2 ++
 plugins/xrandr/gsd-xrandr-manager.c   |    1 +
 3 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index d2020c1..1d60723 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -3837,6 +3837,8 @@ gsd_power_manager_stop (GsdPowerManager *manager)
                 manager->priv->timeout_sleep_id = 0;
         }
 
+        g_signal_handlers_disconnect_by_data (manager->priv->up_client, manager);
+
         g_object_unref (manager->priv->session);
         g_object_unref (manager->priv->settings);
         g_object_unref (manager->priv->settings_screensaver);
diff --git a/plugins/updates/gsd-updates-refresh.c b/plugins/updates/gsd-updates-refresh.c
index 60d5f80..cb15996 100644
--- a/plugins/updates/gsd-updates-refresh.c
+++ b/plugins/updates/gsd-updates-refresh.c
@@ -616,6 +616,8 @@ gsd_updates_refresh_finalize (GObject *object)
         if (refresh->priv->force_get_updates_login_timeout_id != 0)
                 g_source_remove (refresh->priv->force_get_updates_login_timeout_id);
 
+        g_signal_handlers_disconnect_by_data (refresh->priv->client, refresh);
+
         g_object_unref (refresh->priv->control);
         g_object_unref (refresh->priv->settings);
         g_object_unref (refresh->priv->client);
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index 570553a..3da2b7f 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -2026,6 +2026,7 @@ gsd_xrandr_manager_stop (GsdXrandrManager *manager)
         }
 
         if (manager->priv->upower_client != NULL) {
+                g_signal_handlers_disconnect_by_data (manager->priv->upower_client, manager);
                 g_object_unref (manager->priv->upower_client);
                 manager->priv->upower_client = NULL;
         }



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