changeset 13260:2d5a1d2a520e

[gaim-migrate @ 15626] Don't destroy connections until the cows come home committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 12 Feb 2006 23:19:36 +0000
parents 3128ef5250ad
children 3b04ab4d96db
files src/protocols/oscar/conn.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/conn.c	Sun Feb 12 23:00:33 2006 +0000
+++ b/src/protocols/oscar/conn.c	Sun Feb 12 23:19:36 2006 +0000
@@ -98,7 +98,7 @@
 	aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;
 	struct snacgroup *sg;
 
-	sg = malloc(sizeof(struct snacgroup));
+	sg = g_new(struct snacgroup, 1);
 
 	gaim_debug_misc("oscar", "adding group 0x%04x\n", group);
 	sg->group = group;
@@ -135,7 +135,6 @@
 connkill_snacgroups(struct snacgroup *head)
 {
 	struct snacgroup *sg;
-
 	for (sg = head; sg; )
 	{
 		struct snacgroup *tmp;
@@ -186,7 +185,7 @@
 	if (conn->type == AIM_CONN_TYPE_CHAT)
 		aim_conn_kill_chat(sess, conn);
 
-	if (conn->inside)
+	if (conn->inside != NULL)
 	{
 		aim_conn_inside_t *inside = (aim_conn_inside_t *)conn->inside;
 
@@ -198,6 +197,8 @@
 
 	gaim_circ_buffer_destroy(conn->buffer_outgoing);
 	g_free(conn);
+
+	sess->oscar_connections = g_list_remove(sess->oscar_connections, conn);
 }
 
 /**
@@ -261,8 +262,6 @@
 	if (!conn)
 		return;
 
-	sess->oscar_connections = g_list_remove(sess->oscar_connections, conn);
-
 	oscar_connection_destroy(sess, conn);
 }