From f08387c983eb18fd43ff216d19b7ecdfd54c4e5b Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 22 Apr 2010 00:44:19 +0000 Subject: Add lasso_release_gstring --- lasso/utils.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lasso/utils.h b/lasso/utils.h index f2467996..3b28497b 100644 --- a/lasso/utils.h +++ b/lasso/utils.h @@ -175,6 +175,15 @@ #define lasso_release_ghashtable(dest) \ lasso_release_full2(dest, g_hash_table_destroy, GHashTable*) +#define lasso_release_gstring(dest, b) \ + { \ + GString **__tmp = &(dest); \ + if (*__tmp) {\ + g_string_free(*__tmp, (b)); \ + *__tmp = NULL; \ + } \ + } + /* Assignment and list appending */ /* * lasso_assign_xxx macros ensure that you dot leak previous value of assigned things, they use -- cgit