[evolution/gnome-3-6] Do not crash in create_default_shell()



commit aea55dd5cf51c6046dea6bcb662781cb69ef6012
Author: Milan Crha <mcrha redhat com>
Date:   Wed Oct 17 14:12:05 2012 +0200

    Do not crash in create_default_shell()

 shell/main.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/shell/main.c b/shell/main.c
index 2dbb132..344720e 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -420,10 +420,13 @@ create_default_shell (void)
 		NULL);
 
 	/* Failure to register is fatal. */
-	if (error != NULL)
-		g_error ("%s", error->message);
+	if (error != NULL) {
+		g_warning ("Cannot start Evolution, other instance is probably running and is unresponsive. System error: %s",
+			error->message);
+		g_clear_error (&error);
+	}
 
-	if (force_online)
+	if (force_online && shell)
 		e_shell_lock_network_available (shell);
 
 	g_object_unref (settings);
@@ -656,6 +659,8 @@ main (gint argc,
 		e_ensure_type (WEBKIT_TYPE_WEB_VIEW);
 
 	shell = create_default_shell ();
+	if (!shell)
+		return 1;
 
 	if (quit) {
 		e_shell_quit (shell, E_SHELL_QUIT_OPTION);



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