pidgin: 9c25d032: Free the KeyValuePairs associated with a...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Mon Jul 27 22:40:23 EDT 2009
-----------------------------------------------------------------
Revision: 9c25d032749a8658166756edb40cd7b1a0654efe
Ancestor: 079eb15f6ec053c4447c8a97f3b60f266270f799
Author: stefan.becker at nokia.com
Date: 2009-07-27T23:14:24
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/9c25d032749a8658166756edb40cd7b1a0654efe
Modified files:
ChangeLog libpurple/accountopt.c
ChangeLog:
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Patch from Stefan Becker with minor addition by me.
-------------- next part --------------
============================================================
--- ChangeLog aa39c52c1e75241640066444a6227e87e97a6ff0
+++ ChangeLog e997843b9ae2354c38619a6001b0eeb3bf7c7e7f
@@ -10,7 +10,8 @@ version 2.6.0 (??/??/2009):
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.
============================================================
--- libpurple/accountopt.c 14e8bf867d82dedf93964734bd4cce22ade5a4b0
+++ libpurple/accountopt.c 936c7a55e737721760d3f576695d3f5a981b53c3
@@ -111,6 +111,16 @@ purple_account_option_list_new(const cha
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 @@ purple_account_option_destroy(PurpleAcco
{
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 @@ purple_account_option_set_list(PurpleAcc
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);
}
More information about the Commits
mailing list