changeset 6018:d4caf585f6ff

[gaim-migrate @ 6468] Nizathan: I'm reverting your connection.c changes that were supposed to fix jabber (at least, I hope so). It was causing aim to crash on signon because do_away_menu() was getting called when the aim gc existed, but was signed offline (and the aim away menu thing looks at gc->data, which has already been freed by this point). You should talk to Christian if you have any questions, because I don't really know what's going on :-) committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 04 Jul 2003 21:29:55 +0000
parents 968a00c9f230
children 272c761c52e3
files src/connection.c
diffstat 1 files changed, 5 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/connection.c	Fri Jul 04 19:16:48 2003 +0000
+++ b/src/connection.c	Fri Jul 04 21:29:55 2003 +0000
@@ -50,8 +50,6 @@
 	gaim_connection_set_account(gc, account);
 	gaim_account_set_connection(account, gc);
 
-	connections = g_list_append(connections, gc);
-
 	return gc;
 }
 
@@ -71,8 +69,6 @@
 	gaim_debug(GAIM_DEBUG_INFO, "connection",
 			   "Destroying connection %p\n", gc);
 
-	connections = g_list_remove(connections, gc);
-
 	account = gaim_connection_get_account(gc);
 	gaim_account_set_connection(account, NULL);
 
@@ -122,6 +118,8 @@
 
 	gaim_debug(GAIM_DEBUG_INFO, "connection", "Calling serv_login\n");
 
+	connections = g_list_append(connections, gc);
+
 	serv_login(account);
 }
 
@@ -149,6 +147,8 @@
 
 		serv_close(gc);
 
+		connections = g_list_remove(connections, gc);
+
 		gaim_connection_set_state(gc, GAIM_DISCONNECTED);
 
 		gaim_event_broadcast(event_signoff, gc);
@@ -348,19 +348,6 @@
 		ops->notice(gc, text);
 }
 
-static gboolean disconnect_conn_cb(gpointer data)
-{
-	GaimAccount *account = (GaimAccount *)data;
-	GaimConnection *gc;
-
-	gc = gaim_account_get_connection(account);
-
-	if (gc != NULL)
-		gaim_connection_disconnect(data);
-
-	return FALSE;
-}
-
 void
 gaim_connection_error(GaimConnection *gc, const char *text)
 {
@@ -374,7 +361,7 @@
 	if (ops != NULL && ops->disconnected != NULL)
 		ops->disconnected(gc, text);
 
-	g_timeout_add(0, disconnect_conn_cb, gaim_connection_get_account(gc));
+	gaim_connection_disconnect(gc);
 }
 
 void