changeset 30967:b1022aa66b8a

Call msn_transaction_destroy from msn_cmdproc_send_trans. This way, it always owns in some way the transaction after being called.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 27 Nov 2010 07:08:24 +0000
parents cc32d5f81523
children 5e6997ae07e2
files libpurple/protocols/msn/cmdproc.c libpurple/protocols/msn/msn.c libpurple/protocols/msn/notification.c libpurple/protocols/msn/switchboard.c
diffstat 4 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/cmdproc.c	Wed Nov 24 05:57:48 2010 +0000
+++ b/libpurple/protocols/msn/cmdproc.c	Sat Nov 27 07:08:24 2010 +0000
@@ -122,7 +122,7 @@
 	servconn = cmdproc->servconn;
 
 	if (!servconn->connected) {
-		/* TODO: Need to free trans */
+		msn_transaction_destroy(trans);
 		return;
 	}
 
@@ -156,6 +156,8 @@
 
 	msn_servconn_write(servconn, data, len);
 
+	if (!trans->saveable)
+		msn_transaction_destroy(trans);
 	g_free(data);
 }
 
--- a/libpurple/protocols/msn/msn.c	Wed Nov 24 05:57:48 2010 +0000
+++ b/libpurple/protocols/msn/msn.c	Sat Nov 27 07:08:24 2010 +0000
@@ -2100,7 +2100,6 @@
 		trans = msn_transaction_new(cmdproc, "PNG", NULL);
 		msn_transaction_set_saveable(trans, FALSE);
 		msn_cmdproc_send_trans(cmdproc, trans);
-		msn_transaction_destroy(trans);
 	}
 }
 
--- a/libpurple/protocols/msn/notification.c	Wed Nov 24 05:57:48 2010 +0000
+++ b/libpurple/protocols/msn/notification.c	Sat Nov 27 07:08:24 2010 +0000
@@ -309,7 +309,6 @@
 	trans = msn_transaction_new(notification->cmdproc, "OUT", NULL);
 	msn_transaction_set_saveable(trans, FALSE);
 	msn_cmdproc_send_trans(notification->cmdproc, trans);
-	msn_transaction_destroy(trans);
 
 	msn_notification_disconnect(notification);
 }
--- a/libpurple/protocols/msn/switchboard.c	Wed Nov 24 05:57:48 2010 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Sat Nov 27 07:08:24 2010 +0000
@@ -1147,7 +1147,6 @@
 		trans = msn_transaction_new(cmdproc, "OUT", NULL);
 		msn_transaction_set_saveable(trans, FALSE);
 		msn_cmdproc_send_trans(cmdproc, trans);
-		msn_transaction_destroy(trans);
 
 		msn_switchboard_destroy(swboard);
 	}