changeset 28046:9776f3c01268

merge of '5d299fb56a8e77822296cd70281b61ed0fa3b613' and '9c25d032749a8658166756edb40cd7b1a0654efe'
author Paul Aurich <paul@darkrain42.org>
date Tue, 28 Jul 2009 02:37:45 +0000
parents 813f2eb3fdc8 (current diff) b5e52173ef67 (diff)
children c59d130f2ef6
files
diffstat 3 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jul 28 02:30:39 2009 +0000
+++ b/ChangeLog	Tue Jul 28 02:37:45 2009 +0000
@@ -10,7 +10,8 @@
 	  in a group on the buddy list.
 	* Removed the unmaintained and unneeded toc protocol plugin.
 	* Fixed NTLM authentication on big-endian systems.
-	* Various memory cleanups when unloading libpurple. (Nick Hebner)
+	* Various memory cleanups when unloading libpurple. (Nick Hebner and
+	  Stefan Becker)
 	* Report idle time 'From last message sent' should work properly.
 	* DNS servers are re-read when DNS queries fail in case the system has
 	  moved to a new network and the old servers are not accessible.
--- a/libpurple/accountopt.c	Tue Jul 28 02:30:39 2009 +0000
+++ b/libpurple/accountopt.c	Tue Jul 28 02:37:45 2009 +0000
@@ -111,6 +111,16 @@
 	return option;
 }
 
+static void
+purple_account_option_list_free(gpointer data, gpointer user_data)
+{
+	PurpleKeyValuePair *kvp = data;
+
+	g_free(kvp->value);
+	g_free(kvp->key);
+	g_free(kvp);
+}
+
 void
 purple_account_option_destroy(PurpleAccountOption *option)
 {
@@ -127,7 +137,7 @@
 	{
 		if (option->default_value.list != NULL)
 		{
-			g_list_foreach(option->default_value.list, (GFunc)g_free, NULL);
+			g_list_foreach(option->default_value.list, purple_account_option_list_free, NULL);
 			g_list_free(option->default_value.list);
 		}
 	}
@@ -183,7 +193,7 @@
 
 	if (option->default_value.list != NULL)
 	{
-		g_list_foreach(option->default_value.list, (GFunc)g_free, NULL);
+		g_list_foreach(option->default_value.list, purple_account_option_list_free, NULL);
 		g_list_free(option->default_value.list);
 	}
 
--- a/libpurple/blist.c	Tue Jul 28 02:30:39 2009 +0000
+++ b/libpurple/blist.c	Tue Jul 28 02:37:45 2009 +0000
@@ -2432,6 +2432,9 @@
 	hb.name = (gchar *)purple_normalize(account, name);
 
 	for (group = purplebuddylist->root; group; group = group->next) {
+		if (!group->child)
+			continue;
+
 		hb.group = group;
 		if ((buddy = g_hash_table_lookup(purplebuddylist->buddies, &hb))) {
 			return buddy;
@@ -2481,6 +2484,9 @@
 		hb.account = account;
 
 		for (node = purplebuddylist->root; node != NULL; node = node->next) {
+			if (!node->child)
+				continue;
+
 			hb.group = node;
 			if ((buddy = g_hash_table_lookup(purplebuddylist->buddies, &hb)) != NULL)
 				ret = g_slist_prepend(ret, buddy);