pidgin: 09a65bb7: Correct the ref counts on the SlpMsgPart...

qulogic at pidgin.im qulogic at pidgin.im
Thu Dec 16 02:27:27 EST 2010


----------------------------------------------------------------------
Revision: 09a65bb73003c142758c198a8bf222beb71da1b5
Parent:   3879baf4c4d61a033a0b1aa98d65d4f735d3bf60
Author:   qulogic at pidgin.im
Date:     12/15/10 19:14:49
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/09a65bb73003c142758c198a8bf222beb71da1b5

Changelog: 

Correct the ref counts on the SlpMsgParts. When it's removed from the
list in the slpmsg, it should be unref'd, and when it's queued, it
should be ref'd. That should fix the leaks HanzZ saw.

Refs #13084.

Changes against parent 3879baf4c4d61a033a0b1aa98d65d4f735d3bf60

  patched  libpurple/protocols/msn/directconn.c
  patched  libpurple/protocols/msn/slpmsg_part.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/directconn.c	d460d3063a183c5462e17fca6884dce66dc0315c
+++ libpurple/protocols/msn/directconn.c	87ef3cddffb1ad7fc0f5f0498a1e263d026aaab7
@@ -552,7 +552,7 @@ msn_dc_enqueue_part(MsnDirectConn *dc, M
 	memcpy(p->data + P2P_PACKET_HEADER_SIZE, part->buffer, part->size);
 
 	p->sent_cb = msn_dc_send_packet_cb;
-	p->part = part;
+	p->part = msn_slpmsgpart_ref(part);
 
 	msn_dc_enqueue_packet(dc, p);
 }
============================================================
--- libpurple/protocols/msn/slpmsg_part.c	5172e1f79f702224e71cae2720012dd682b3b116
+++ libpurple/protocols/msn/slpmsg_part.c	2101e8a6f5d9d4680eafaed0960eb95d60b43df8
@@ -183,6 +183,7 @@ msn_slpmsgpart_ack(MsnSlpMessagePart *pa
 	slpmsg->header->offset += part->header->length;
 
 	slpmsg->parts = g_list_remove(slpmsg->parts, part);
+	msn_slpmsgpart_unref(part);
 
 	if (slpmsg->header->offset < real_size)
 	{
@@ -220,5 +221,6 @@ msn_slpmsgpart_nak(MsnSlpMessagePart *pa
 	msn_slplink_send_msgpart(slpmsg->slplink, slpmsg);
 
 	slpmsg->parts = g_list_remove(slpmsg->parts, part);
+	msn_slpmsgpart_unref(part);
 }
 


More information about the Commits mailing list