--- a/libpurple/blist.c Fri Jan 02 22:23:19 2009 +0000 +++ b/libpurple/blist.c Fri Jan 02 22:23:38 2009 +0000 @@ -1861,6 +1861,8 @@ PurpleContact *contact; PurpleGroup *group; struct _purple_hbuddy hb; + PurplePlugin *prpl; + PurplePluginProtocolInfo *prpl_info; g_return_if_fail(buddy != NULL); @@ -1916,6 +1918,15 @@ /* Signal that the buddy has been removed before freeing the memory for it */ purple_signal_emit(purple_blist_get_handle(), "buddy-removed", buddy); + /* + * Tell the owner PRPL that we're about to free the buddy so it + * can free proto_data + */ + prpl = purple_find_prpl(purple_account_get_protocol_id(buddy->account)); + prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); + if (prpl_info && prpl_info->buddy_free) + prpl_info->buddy_free(buddy); + /* Delete the node */ purple_buddy_icon_unref(buddy->icon); g_hash_table_destroy(buddy->node.settings);