[gdm/multi-stack: 21/35] Prevent start session signal handler from getting called multiple times



commit 74b5fbd516671be45a6305ef19147458f713148c
Author: Ray Strode <rstrode redhat com>
Date:   Wed Oct 28 11:13:10 2009 -0400

    Prevent start session signal handler from getting called multiple times
    
    It was causing a double free.

 gui/simple-greeter/gdm-greeter-login-window.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-greeter-login-window.c b/gui/simple-greeter/gdm-greeter-login-window.c
index 938e523..0fb6c64 100644
--- a/gui/simple-greeter/gdm-greeter-login-window.c
+++ b/gui/simple-greeter/gdm-greeter-login-window.c
@@ -1091,8 +1091,17 @@ on_ready_to_start_session (GdmGreeterLoginWindow *login_window,
                            GParamSpec            *param_spec,
                            char                  *service_name)
 {
+        if (!login_window->priv->is_interactive) {
+                return;
+        }
+
         gdm_greeter_login_window_start_session_when_ready (login_window, service_name);
         g_free (service_name);
+
+        if (login_window->priv->start_session_handler_id > 0) {
+                g_signal_handler_disconnect (login_window, login_window->priv->start_session_handler_id);
+                login_window->priv->start_session_handler_id = 0;
+        }
 }
 
 static void



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