diff src/server.c @ 2017:eee309c0de93

[gaim-migrate @ 2027] this is better. also plugged a mem leak for when you left a chat after you were disconnected. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 14 Jun 2001 21:43:59 +0000
parents 9187e83c8b03
children 3366311426df
line wrap: on
line diff
--- a/src/server.c	Thu Jun 14 17:33:25 2001 +0000
+++ b/src/server.c	Thu Jun 14 21:43:59 2001 +0000
@@ -61,13 +61,10 @@
 
 void serv_close(struct gaim_connection *gc)
 {
-	GSList *bcs = gc->buddy_chats;
-	struct conversation *b;
-	while (bcs) {
-		b = (struct conversation *)bcs->data;
+	while (gc->buddy_chats) {
+		struct conversation *b = gc->buddy_chats->data;
 		gc->buddy_chats = g_slist_remove(gc->buddy_chats, b);
 		b->gc = NULL;
-		bcs = gc->buddy_chats;
 	}
 
 	if (gc->idle_timer > 0)
@@ -870,19 +867,7 @@
 
 	g->buddy_chats = g_slist_remove(g->buddy_chats, b);
 
-	while (b->in_room) {
-		char *tmp = b->in_room->data;
-		b->in_room = g_list_remove(b->in_room, tmp);
-		g_free(tmp);
-	}
-
-	while (b->ignored) {
-		g_free(b->ignored->data);
-		b->ignored = g_list_remove(b->ignored, b->ignored->data);
-	}
-
-	g_string_free(b->history, TRUE);
-	g_free(b);
+	delete_chat(b);
 }
 
 void serv_got_chat_in(struct gaim_connection *g, int id, char *who, int whisper, char *message, time_t mtime)