changeset 21777:306ee626481d

Plug another leak or two, remove a comment, and reorganize a couple functions.
author Etan Reisner <pidgin@unreliablesource.net>
date Sat, 01 Dec 2007 06:46:25 +0000
parents 4b33d4185342
children e8e9a53b7694
files libpurple/plugins/perl/common/Status.xs
diffstat 1 files changed, 21 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- 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