changeset 6013:9ab75d4fafac

[gaim-migrate @ 6461] This should fix any crashes or infinite loops when calling gaim_connection_error(), followed by gaim_connection_disconnect(). committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 04 Jul 2003 06:43:21 +0000
parents 4c16227f7cd9
children 66a8e4938e17
files src/connection.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/connection.c	Fri Jul 04 06:10:33 2003 +0000
+++ b/src/connection.c	Fri Jul 04 06:43:21 2003 +0000
@@ -350,7 +350,14 @@
 
 static gboolean disconnect_conn_cb(gpointer data)
 {
-	gaim_connection_disconnect(data);
+	GaimAccount *account = (GaimAccount *)data;
+	GaimConnection *gc;
+
+	gc = gaim_account_get_connection(account);
+
+	if (gc != NULL)
+		gaim_connection_disconnect(data);
+
 	return FALSE;
 }
 
@@ -367,7 +374,7 @@
 	if (ops != NULL && ops->disconnected != NULL)
 		ops->disconnected(gc, text);
 
-	g_timeout_add(0, disconnect_conn_cb, gc);
+	g_timeout_add(0, disconnect_conn_cb, gaim_connection_get_account(gc));
 }
 
 void