[libgsystem] localalloc: add gs_free_slist
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgsystem] localalloc: add gs_free_slist
- Date: Tue, 15 Jul 2014 20:26:52 +0000 (UTC)
commit 1462c8110bf731222a3d57e96f31e9835652b0f4
Author: Thomas Haller <thaller redhat com>
Date: Tue Jul 15 20:00:09 2014 +0200
localalloc: add gs_free_slist
Signed-off-by: Thomas Haller <thaller redhat com>
src/gsystem-local-alloc.h | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]