[gnome-settings-daemon] color: Don't leak notification objects



commit 50b7673eeb67442499a4969ee5f0c61fc0b2e718
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jun 29 23:56:54 2012 -0400

    color: Don't leak notification objects
    
    Signed-off-by: Richard Hughes <richard hughsie com>

 plugins/color/gsd-color-manager.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/plugins/color/gsd-color-manager.c b/plugins/color/gsd-color-manager.c
index cd584ea..a92b3d1 100644
--- a/plugins/color/gsd-color-manager.c
+++ b/plugins/color/gsd-color-manager.c
@@ -1763,10 +1763,17 @@ gcm_session_notify_cb (NotifyNotification *notification,
         GsdColorManager *manager = GSD_COLOR_MANAGER (user_data);
 
         if (g_strcmp0 (action, "recalibrate") == 0) {
+                notify_notification_close (notification, NULL);
                 gcm_session_exec_control_center (manager);
         }
 }
 
+static void
+closed_cb (NotifyNotification *notification, gpointer data)
+{
+        g_object_unref (notification);
+}
+
 static gboolean
 gcm_session_notify_recalibrate (GsdColorManager *manager,
                                 const gchar *title,
@@ -1791,6 +1798,7 @@ gcm_session_notify_recalibrate (GsdColorManager *manager,
                                         gcm_session_notify_cb,
                                         priv, NULL);
 
+        g_signal_connect (notification, "closed", G_CALLBACK (closed_cb), NULL);
         ret = notify_notification_show (notification, &error);
         if (!ret) {
                 g_warning ("failed to show notification: %s",



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