changeset 12236:2cfd36ba0f45

[gaim-migrate @ 14538] Richard pointed out we shouldn't be unref()ing here, and valgrind confirmed it. I left myself a note so I don't do silly things again. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sun, 27 Nov 2005 17:47:17 +0000
parents 62bed9e1bce0
children 3294e27cb54a
files src/protocols/msn/switchboard.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/switchboard.c	Sun Nov 27 17:38:19 2005 +0000
+++ b/src/protocols/msn/switchboard.c	Sun Nov 27 17:47:17 2005 +0000
@@ -99,12 +99,10 @@
 
 	g_queue_free(swboard->msg_queue);
 
-	while((l = swboard->ack_list) != NULL)
-	{
-		msg = l->data;
-		msg_error_helper(swboard->cmdproc, msg, MSN_MSG_ERROR_SB);
-		msn_message_unref(msg);
-	}
+	/* msg_error_helper will both remove the msg from ack_list and
+	   unref it, so we don't need to do either here */
+	while ((l = swboard->ack_list) != NULL)
+		msg_error_helper(swboard->cmdproc, l->data, MSN_MSG_ERROR_SB);
 
 	if (swboard->im_user != NULL)
 		g_free(swboard->im_user);