changeset 18804:b839f427cbb2

More minor leak fixes and cleanup to bonjour.
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 06 Aug 2007 00:12:52 +0000
parents abb9aac69507
children 9377e741f5b2
files libpurple/protocols/bonjour/mdns_common.c libpurple/protocols/bonjour/mdns_howl.c libpurple/protocols/bonjour/mdns_win32.c
diffstat 3 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/mdns_common.c	Sun Aug 05 19:42:29 2007 +0000
+++ b/libpurple/protocols/bonjour/mdns_common.c	Mon Aug 06 00:12:52 2007 +0000
@@ -111,5 +111,6 @@
 	_mdns_stop(data);
 
 	gc = purple_account_get_connection(data->account);
-	purple_input_remove(gc->inpa);
+	if (gc->inpa > 0)
+		purple_input_remove(gc->inpa);
 }
--- a/libpurple/protocols/bonjour/mdns_howl.c	Sun Aug 05 19:42:29 2007 +0000
+++ b/libpurple/protocols/bonjour/mdns_howl.c	Mon Aug 06 00:12:52 2007 +0000
@@ -145,7 +145,7 @@
 			break;
 		case SW_DISCOVERY_BROWSE_REMOVE_SERVICE:
 			purple_debug_info("bonjour", "_browser_reply --> Remove service\n");
-			gb = purple_find_buddy((PurpleAccount*)extra, name);
+			gb = purple_find_buddy(account, name);
 			if (gb != NULL)
 			{
 				bonjour_buddy_delete(gb->proto_data);
@@ -258,14 +258,14 @@
 			break;
 	}
 
+	/* Free the memory used by temp data */
+	sw_text_record_fina(dns_data);
+
 	if (publish_result != SW_OKAY) {
-		purple_debug_error("bonjour", "Unable to publish or change the status of the _presence._tcp service.\n");
+		purple_debug_error("bonjour", "Unable to publish or change the status of the " ICHAT_SERVICE " service.\n");
 		return FALSE;
 	}
 
-	/* Free the memory used by temp data */
-	sw_text_record_fina(dns_data);
-
 	return TRUE;
 }
 
@@ -283,7 +283,7 @@
 guint _mdns_register_to_mainloop(BonjourDnsSd *data) {
 	HowlSessionImplData *idata = data->mdns_impl_data;
 
-	g_return_val_if_fail(idata != NULL, FALSE);
+	g_return_val_if_fail(idata != NULL, 0);
 
 	return purple_input_add(sw_discovery_socket(idata->session),
 				PURPLE_INPUT_READ, _mdns_handle_event, idata->session);
--- a/libpurple/protocols/bonjour/mdns_win32.c	Sun Aug 05 19:42:29 2007 +0000
+++ b/libpurple/protocols/bonjour/mdns_win32.c	Mon Aug 06 00:12:52 2007 +0000
@@ -340,7 +340,7 @@
 guint _mdns_register_to_mainloop(BonjourDnsSd *data) {
 	Win32SessionImplData *idata = data->mdns_impl_data;
 
-	g_return_val_if_fail(idata != NULL, FALSE);
+	g_return_val_if_fail(idata != NULL, 0);
 
 	return purple_input_add(DNSServiceRefSockFD(idata->browser),
 				PURPLE_INPUT_READ, _mdns_handle_event, idata->browser);