[gnome-session] Fix some problems in the systemd code



commit 5dc795f32bf7eae5c12d36cd289cf9b9f6438255
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Apr 5 22:00:17 2012 -0400

    Fix some problems in the systemd code
    
    The stop and restart functions forgot to pass the manager
    object down, and then tried to emit signals on a NULL
    object. Also, we were unreffing a variant that was NULL
    half the time. Don't do that.
    
    Fixes the problem where a poweroff request in the presence
    of multiple user sessions leads to a PolicyKit dialog that
    comes back every time it is canceled.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673619

 gnome-session/gsm-systemd.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gnome-session/gsm-systemd.c b/gnome-session/gsm-systemd.c
index 5bf64b0..0907bfb 100644
--- a/gnome-session/gsm-systemd.c
+++ b/gnome-session/gsm-systemd.c
@@ -208,9 +208,8 @@ restart_done (GObject      *source,
                 g_error_free (error);
         } else {
                 emit_restart_complete (manager, NULL);
+                g_variant_unref (res);
         }
-
-        g_variant_unref (res);
 }
 
 static void
@@ -225,7 +224,7 @@ gsm_systemd_attempt_restart (GsmSystem *system)
                            G_MAXINT,
                            NULL,
                            restart_done,
-                           NULL);
+                           manager);
 }
 
 static void
@@ -246,9 +245,8 @@ stop_done (GObject      *source,
                 g_error_free (error);
         } else {
                 emit_stop_complete (manager, NULL);
+                g_variant_unref (res);
         }
-
-        g_variant_unref (res);
 }
 
 static void
@@ -263,7 +261,7 @@ gsm_systemd_attempt_stop (GsmSystem *system)
                            G_MAXINT,
                            NULL,
                            stop_done,
-                           NULL);
+                           manager);
 }
 
 static void



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