diff pidgin/gtkmain.c @ 18068:0b3d6ea61760

propagate from branch 'im.pidgin.pidgin' (head 4b50880d8517570eaa67d4cd9d88c5934bb832f1) to branch 'im.pidgin.pidgin.2.1.0' (head fefd59692d4177b91d52f6d71b1565b76c88725d)
author Richard Laager <rlaager@wiktel.com>
date Thu, 07 Jun 2007 14:48:33 +0000
parents 4ca97b26a8fb
children 926ccb104da0 40d51793f2d7
line wrap: on
line diff
--- a/pidgin/gtkmain.c	Thu Jun 07 14:47:30 2007 +0000
+++ b/pidgin/gtkmain.c	Thu Jun 07 14:48:33 2007 +0000
@@ -127,7 +127,7 @@
 		}
 		g_strfreev(names);
 	} else { /* no name given, use the first account */
-		GList *accounts;
+		const GList *accounts;
 
 		accounts = purple_accounts_get_all();
 		if (accounts != NULL)
@@ -441,7 +441,7 @@
 	char *opt_session_arg = NULL;
 	int dologin_ret = -1;
 	char *search_path;
-	GList *accounts;
+	const GList *accounts;
 #ifdef HAVE_SIGNAL_H
 	int sig_indx;	/* for setting up signal catching */
 	sigset_t sigset;
@@ -456,6 +456,7 @@
 	gboolean gui_check;
 	gboolean debug_enabled;
 	gboolean migration_failed = FALSE;
+	GList *active_accounts;
 
 	struct option long_options[] = {
 		{"config",   required_argument, NULL, 'c'},
@@ -733,6 +734,15 @@
 		abort();
 	}
 
+	if (!purple_core_ensure_single_instance()) {
+		purple_core_quit();
+#ifdef HAVE_SIGNAL_H
+		g_free(segfault_message);
+#endif
+		return 0;
+	}
+		
+
 	/* TODO: Move blist loading into purple_blist_init() */
 	purple_set_blist(purple_blist_new());
 	purple_blist_load();
@@ -819,13 +829,13 @@
 		purple_accounts_restore_current_statuses();
 	}
 
-	if ((accounts = purple_accounts_get_all_active()) == NULL)
+	if ((active_accounts = purple_accounts_get_all_active()) == NULL)
 	{
 		pidgin_accounts_window_show();
 	}
 	else
 	{
-		g_list_free(accounts);
+		g_list_free(active_accounts);
 	}
 
 #ifdef HAVE_STARTUP_NOTIFICATION