~agateau/lightdm/lightdm-defaults

« back to all changes in this revision

Viewing changes to src/lightdm.c

  • Committer: Robert Ancell
  • Date: 2011-12-21 06:12:41 UTC
  • Revision ID: robert.ancell@canonical.com-20111221061241-96igxbx7bfqdhx8d
Fix crash when quitting with newer GLib

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
static GTimer *log_timer;
36
36
static int log_fd = -1;
37
37
static gboolean debug = FALSE;
38
 
static gboolean stopping = FALSE;
39
38
 
40
39
static DisplayManager *display_manager = NULL;
41
40
static XDMCPServer *xdmcp_server = NULL;
142
141
static gboolean
143
142
exit_cb (gpointer data)
144
143
{
145
 
    exit (exit_code);
146
 
}
147
 
 
148
 
static void
149
 
display_manager_stopped_cb (DisplayManager *display_manager)
150
 
{
151
 
    g_debug ("Stopping Light Display Manager");
152
 
 
153
 
    /* Mark as stopping because bus_acquired_cb can be called after this function, and even
154
 
     * more weirdly display_manager is not NULL even though the following lines set it to
155
 
     * be! */
156
 
    stopping = TRUE;
157
 
 
158
144
    /* Clean up display manager */
159
145
    g_object_unref (display_manager);
160
146
    display_manager = NULL;
166
152
    if (session_bus_entries)
167
153
        g_hash_table_unref (session_bus_entries);
168
154
 
 
155
    g_debug ("Exiting with return value %d", exit_code);
 
156
    exit (exit_code);
 
157
}
 
158
 
 
159
static void
 
160
display_manager_stopped_cb (DisplayManager *display_manager)
 
161
{
 
162
    g_debug ("Stopping daemon");
169
163
    g_idle_add (exit_cb, NULL);
170
164
}
171
165
 
515
509
static void
516
510
session_stopped_cb (Session *session, Seat *seat)
517
511
{
 
512
    g_signal_handlers_disconnect_matched (session, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, seat);
518
513
    g_hash_table_remove (session_bus_entries, session);
519
514
}
520
515
 
606
601
static void
607
602
seat_removed_cb (DisplayManager *display_manager, Seat *seat)
608
603
{
 
604
    gboolean exit_on_failure;
 
605
 
 
606
    exit_on_failure = seat_get_boolean_property (seat, "exit-on-failure");
609
607
    g_hash_table_remove (seat_bus_entries, seat);
610
608
 
611
 
    if (seat_get_boolean_property (seat, "exit-on-failure"))
 
609
    if (exit_on_failure)
612
610
    {
613
 
        g_debug ("Stopping lightdm, required seat has stopped");
 
611
        g_debug ("Required seat has stopped");
614
612
        exit_code = EXIT_FAILURE;
615
613
        display_manager_stop (display_manager);
616
614
    }
680
678
    GDBusNodeInfo *display_manager_info;
681
679
    GList *link;
682
680
 
683
 
    if (stopping)
684
 
        return;
685
 
 
686
681
    g_debug ("Acquired bus name %s", name);
687
682
 
688
683
    bus = connection;