summaryrefslogtreecommitdiff
path: root/src/lightdm.c
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2011-12-21 17:12:41 +1100
committerRobert Ancell <robert.ancell@canonical.com>2011-12-21 17:12:41 +1100
commit17cc6fc81d9c615ec81d1f9e0094c101c5632bf7 (patch)
treeeb84f09d821e0d5a53d853f31f0b418f1a09f62f /src/lightdm.c
parent808d17d82ea3f7ba9dcb428e5b49ac6c628c99cb (diff)
downloadlightdm-17cc6fc81d9c615ec81d1f9e0094c101c5632bf7.tar.gz
Fix crash when quitting with newer GLib
Diffstat (limited to 'src/lightdm.c')
-rw-r--r--src/lightdm.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/lightdm.c b/src/lightdm.c
index 16e17558..019d6af4 100644
--- a/src/lightdm.c
+++ b/src/lightdm.c
@@ -35,7 +35,6 @@ static GMainLoop *loop = NULL;
static GTimer *log_timer;
static int log_fd = -1;
static gboolean debug = FALSE;
-static gboolean stopping = FALSE;
static DisplayManager *display_manager = NULL;
static XDMCPServer *xdmcp_server = NULL;
@@ -142,19 +141,6 @@ signal_cb (Process *process, int signum)
static gboolean
exit_cb (gpointer data)
{
- exit (exit_code);
-}
-
-static void
-display_manager_stopped_cb (DisplayManager *display_manager)
-{
- g_debug ("Stopping Light Display Manager");
-
- /* Mark as stopping because bus_acquired_cb can be called after this function, and even
- * more weirdly display_manager is not NULL even though the following lines set it to
- * be! */
- stopping = TRUE;
-
/* Clean up display manager */
g_object_unref (display_manager);
display_manager = NULL;
@@ -166,6 +152,14 @@ display_manager_stopped_cb (DisplayManager *display_manager)
if (session_bus_entries)
g_hash_table_unref (session_bus_entries);
+ g_debug ("Exiting with return value %d", exit_code);
+ exit (exit_code);
+}
+
+static void
+display_manager_stopped_cb (DisplayManager *display_manager)
+{
+ g_debug ("Stopping daemon");
g_idle_add (exit_cb, NULL);
}
@@ -515,6 +509,7 @@ start_session_cb (Display *display, Seat *seat)
static void
session_stopped_cb (Session *session, Seat *seat)
{
+ g_signal_handlers_disconnect_matched (session, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, seat);
g_hash_table_remove (session_bus_entries, session);
}
@@ -606,11 +601,14 @@ seat_added_cb (DisplayManager *display_manager, Seat *seat)
static void
seat_removed_cb (DisplayManager *display_manager, Seat *seat)
{
+ gboolean exit_on_failure;
+
+ exit_on_failure = seat_get_boolean_property (seat, "exit-on-failure");
g_hash_table_remove (seat_bus_entries, seat);
- if (seat_get_boolean_property (seat, "exit-on-failure"))
+ if (exit_on_failure)
{
- g_debug ("Stopping lightdm, required seat has stopped");
+ g_debug ("Required seat has stopped");
exit_code = EXIT_FAILURE;
display_manager_stop (display_manager);
}
@@ -680,9 +678,6 @@ bus_acquired_cb (GDBusConnection *connection,
GDBusNodeInfo *display_manager_info;
GList *link;
- if (stopping)
- return;
-
g_debug ("Acquired bus name %s", name);
bus = connection;