From 1462c8110bf731222a3d57e96f31e9835652b0f4 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 15 Jul 2014 20:00:09 +0200 Subject: localalloc: add gs_free_slist Signed-off-by: Thomas Haller --- src/gsystem-local-alloc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gsystem-local-alloc.h b/src/gsystem-local-alloc.h index ddc8ade..68b1227 100644 --- a/src/gsystem-local-alloc.h +++ b/src/gsystem-local-alloc.h @@ -50,6 +50,7 @@ GS_DEFINE_CLEANUP_FUNCTION0(GKeyFile*, gs_local_keyfile_unref, g_key_file_unref) GS_DEFINE_CLEANUP_FUNCTION0(GError*, gs_local_free_error, g_error_free) GS_DEFINE_CLEANUP_FUNCTION0(GHashTable*, gs_local_hashtable_unref, g_hash_table_unref) GS_DEFINE_CLEANUP_FUNCTION(GList*, gs_local_free_list, g_list_free) +GS_DEFINE_CLEANUP_FUNCTION(GSList*, gs_local_free_slist, g_slist_free) GS_DEFINE_CLEANUP_FUNCTION0(GObject*, gs_local_obj_unref, g_object_unref) GS_DEFINE_CLEANUP_FUNCTION0(GPtrArray*, gs_local_ptrarray_unref, g_ptr_array_unref) GS_DEFINE_CLEANUP_FUNCTION0(GVariant*, gs_local_variant_unref, g_variant_unref) @@ -137,6 +138,15 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free) */ #define gs_free_list __attribute__ ((cleanup(gs_local_free_list))) +/** + * gs_free_slist: + * + * Call g_slist_free() on a variable location when it goes out + * of scope. + */ +#define gs_free_slist __attribute__ ((cleanup(gs_local_free_slist))) + +/** * gs_free_checksum: * * Call g_checksum_free() on a variable location when it goes out -- cgit v1.2.1