# HG changeset patch # User Etan Reisner # Date 1196491585 0 # Node ID 306ee626481d98d11fc5c1ebc9f6f6c6b8bc9e7b # Parent 4b33d418534247d2e5007b49a57b33da6eb973a7 Plug another leak or two, remove a comment, and reorganize a couple functions. diff -r 4b33d4185342 -r 306ee626481d libpurple/plugins/perl/common/Status.xs --- a/libpurple/plugins/perl/common/Status.xs Sat Dec 01 06:45:05 2007 +0000 +++ b/libpurple/plugins/perl/common/Status.xs Sat Dec 01 06:46:25 2007 +0000 @@ -90,6 +90,7 @@ t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(source_list), i, 0), t_sl)); } purple_presence_add_list(presence, t_GL); + g_list_free(t_GL); void purple_presence_add_status(presence, status) @@ -361,28 +362,6 @@ purple_status_type_destroy(status_type) Purple::StatusType status_type -Purple::StatusType -purple_status_type_find_with_id(status_types, id) - SV *status_types - const char *id -PREINIT: -/* XXX Check that this function actually works, I think it might need a */ -/* status_type as it's first argument to work as $status_type->find_with_id */ -/* properly. */ - GList *t_GL; - int i, t_len; -CODE: - t_GL = NULL; - t_len = av_len((AV *)SvRV(status_types)); - - for (i = 0; i < t_len; i++) { - STRLEN t_sl; - t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(status_types), i, 0), t_sl)); - } - RETVAL = (PurpleStatusType *)purple_status_type_find_with_id(t_GL, id); -OUTPUT: - RETVAL - Purple::StatusAttr purple_status_type_get_attr(status_type, id) Purple::StatusType status_type @@ -398,6 +377,26 @@ XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::StatusAttr"))); } +Purple::StatusType +purple_status_type_find_with_id(status_types, id) + SV *status_types + const char *id +PREINIT: + GList *t_GL; + int i, t_len; +CODE: + t_GL = NULL; + t_len = av_len((AV *)SvRV(status_types)); + + for (i = 0; i < t_len; i++) { + STRLEN t_sl; + t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(status_types), i, 0), t_sl)); + } + RETVAL = (PurpleStatusType *)purple_status_type_find_with_id(t_GL, id); + g_list_free(t_GL); +OUTPUT: + RETVAL + const char * purple_status_type_get_id(status_type) Purple::StatusType status_type