[libgsystem] localalloc: Define a #define for gs_unref_keyfile



commit 012bdf72eceda33d430284161231884c348c8081
Author: Colin Walters <walters verbum org>
Date:   Wed Dec 17 20:51:37 2014 -0500

    localalloc: Define a #define for gs_unref_keyfile
    
    This got missed before.

 src/gsystem-local-alloc.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/gsystem-local-alloc.h b/src/gsystem-local-alloc.h
index d217f29..71f444b 100644
--- a/src/gsystem-local-alloc.h
+++ b/src/gsystem-local-alloc.h
@@ -43,7 +43,6 @@ G_BEGIN_DECLS
  * 1) Take a pointer to the location (typically itself a pointer).
  * 2) Provide %NULL-safety where it doesn't exist already (e.g. g_object_unref)
  */
-GS_DEFINE_CLEANUP_FUNCTION0(GKeyFile*, gs_local_keyfile_unref, g_key_file_unref)
 
 /**
  * gs_free:
@@ -177,6 +176,14 @@ GS_DEFINE_CLEANUP_FUNCTION(char**, gs_local_strfreev, g_strfreev)
 #define gs_free_error __attribute__ ((cleanup(gs_local_free_error)))
 GS_DEFINE_CLEANUP_FUNCTION0(GError*, gs_local_free_error, g_error_free)
 
+/**
+ * gs_unref_keyfile:
+ *
+ * Call g_key_file_unref() on a variable location when it goes out of scope.
+ */
+#define gs_unref_keyfile __attribute__ ((cleanup(gs_local_keyfile_unref)))
+GS_DEFINE_CLEANUP_FUNCTION0(GKeyFile*, gs_local_keyfile_unref, g_key_file_unref)
+
 G_END_DECLS
 
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]