soc.2010.msn-tlc: c1ec24f2: Add a ref to the part at sbconn and add ...

masca at cpw.pidgin.im masca at cpw.pidgin.im
Wed Jul 7 21:41:30 EDT 2010


----------------------------------------------------------------------
Revision: c1ec24f2fffff73d5865336290d5bc3059f5e73b
Parent:   a52197a5d3f84d3783b129aa8faee5e7ef827e5b
Author:   masca at cpw.pidgin.im
Date:     07/07/10 17:04:57
Branch:   im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/c1ec24f2fffff73d5865336290d5bc3059f5e73b

Changelog: 

Add a ref to the part at sbconn and add some debug output.

Changes against parent a52197a5d3f84d3783b129aa8faee5e7ef827e5b

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

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/sbconn.c	815264a77ef3b2e69094d7849614c5fa52066c30
+++ libpurple/protocols/msn/sbconn.c	1f7a807c21e550c747ae1deab078ec36aca48a38
@@ -17,7 +17,7 @@ void msn_sbconn_send_part(MsnSlpLink *sl
 	msn_message_set_header(msg, "P2P-Dest", passport);
 
 	data = msn_slpmsgpart_serialize(part, &size);
-	msg->part = part;
+	msg->part = msn_slpmsgpart_ref(part);
 
 	msn_message_set_bin_data(msg, data, size);
 
============================================================
--- libpurple/protocols/msn/slpmsg_part.c	323df8b2607a93ea42ce5d72fd56214969798b9b
+++ libpurple/protocols/msn/slpmsg_part.c	748c56f12fb875ec63c4809f4fb3045711e125e5
@@ -1,4 +1,5 @@
 #include "internal.h"
+#include "debug.h"
 
 #include "slpmsg.h"
 #include "slpmsg_part.h"
@@ -79,6 +80,9 @@ MsnSlpMessagePart *msn_slpmsgpart_ref(Ms
 	g_return_val_if_fail(part != NULL, NULL);
 	part->ref_count ++;
 
+	if (purple_debug_is_verbose())
+		purple_debug_info("msn", "part ref (%p)[%" G_GSIZE_FORMAT "]\n", part, part->ref_count);
+
 	return part;
 }
 
@@ -89,6 +93,9 @@ MsnSlpMessagePart *msn_slpmsgpart_unref(
 
 	part->ref_count--;
 
+	if (purple_debug_is_verbose())
+		purple_debug_info("msn", "part unref (%p)[%" G_GSIZE_FORMAT "]\n", part, part->ref_count);
+
 	if (part->ref_count == 0) {
 		msn_slpmsgpart_destroy(part);
 


More information about the Commits mailing list