diff -r ed70e92f7c28 -r d461ccafa1fb pidgin/gtkmain.c --- a/pidgin/gtkmain.c Fri Jun 15 19:07:02 2007 +0000 +++ b/pidgin/gtkmain.c Fri Jun 15 19:34:24 2007 +0000 @@ -125,7 +125,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) @@ -435,7 +435,7 @@ char *opt_login_arg = NULL; char *opt_session_arg = NULL; char *search_path; - GList *accounts; + const GList *accounts; #ifdef HAVE_SIGNAL_H int sig_indx; /* for setting up signal catching */ sigset_t sigset; @@ -450,6 +450,7 @@ gboolean gui_check; gboolean debug_enabled; gboolean migration_failed = FALSE; + GList *active_accounts; struct option long_options[] = { {"config", required_argument, NULL, 'c'}, @@ -727,6 +728,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(); @@ -822,13 +832,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