[gnome-session] gsm: Make fatal errors exit after error dialog during initialization



commit c6a29dc93da9cf78641adb1d78df36defb3861db
Author: Vincent Untz <vuntz gnome org>
Date:   Tue Mar 22 21:09:05 2011 +0100

    gsm: Make fatal errors exit after error dialog during initialization
    
    While we're setting up everything, there is no main loop, so calling
    gtk_main_quit() usually won't work and the user will be stuck with an
    empty session after the error dialog. So simply call exit() if there is
    no main loop after a fatal error.

 gnome-session/gsm-util.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gnome-session/gsm-util.c b/gnome-session/gsm-util.c
index c3fda1d..3d423e8 100644
--- a/gnome-session/gsm-util.c
+++ b/gnome-session/gsm-util.c
@@ -360,7 +360,10 @@ gsm_util_init_error (gboolean    fatal,
         gtk_widget_destroy (dialog);
 
         if (fatal) {
-                gtk_main_quit ();
+                if (gtk_main_level () > 0)
+                        gtk_main_quit ();
+                else
+                        exit (1);
         }
 }
 



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