# HG changeset patch # User Paul Aurich # Date 1283650256 0 # Node ID a2d5bafdbea9e5eeabaa7f88c50905607926681b # Parent 54461ce5f7e0091177525b61fead7b6dabe07fb7 perl: Fix chat-related functions. Purple::BuddyList::Chat::new needs to copy the strings, since the GHashTable is long-listing. The serv_join_chat wrapper needs to free the hash table, since that one isn't owned by the prpl. diff -r 54461ce5f7e0 -r a2d5bafdbea9 ChangeLog.API --- a/ChangeLog.API Sat Sep 04 17:47:46 2010 +0000 +++ b/ChangeLog.API Sun Sep 05 01:30:56 2010 +0000 @@ -1,6 +1,11 @@ Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul version 2.7.4 (MM/DD/YYYY): + Perl: + Changed: + * Purple::BuddyList::Chat::new now works properly. Thanks + to Rafael in devel@conference.pidgin.im for reporting and + testing. version 2.7.3 (08/10/2010): libpurple: diff -r 54461ce5f7e0 -r a2d5bafdbea9 libpurple/plugins/perl/common/BuddyList.xs --- a/libpurple/plugins/perl/common/BuddyList.xs Sat Sep 04 17:47:46 2010 +0000 +++ b/libpurple/plugins/perl/common/BuddyList.xs Sun Sep 05 01:30:56 2010 +0000 @@ -345,14 +345,14 @@ char *t_key, *t_value; CODE: t_HV = (HV *)SvRV(components); - t_GHash = g_hash_table_new(g_str_hash, g_str_equal); + t_GHash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) { t_key = hv_iterkey(t_HE, &len); t_SV = *hv_fetch(t_HV, t_key, len, 0); t_value = SvPVutf8_nolen(t_SV); - g_hash_table_insert(t_GHash, t_key, t_value); + g_hash_table_insert(t_GHash, g_strdup(t_key), g_strdup(t_value)); } RETVAL = purple_chat_new(account, alias, t_GHash); diff -r 54461ce5f7e0 -r a2d5bafdbea9 libpurple/plugins/perl/common/Server.xs --- a/libpurple/plugins/perl/common/Server.xs Sat Sep 04 17:47:46 2010 +0000 +++ b/libpurple/plugins/perl/common/Server.xs Sun Sep 05 01:30:56 2010 +0000 @@ -144,6 +144,7 @@ g_hash_table_insert(t_GHash, t_key, t_value); } serv_join_chat(conn, t_GHash); + g_hash_table_destroy(t_GHash); void serv_move_buddy(buddy, group1, group2)