core: Add macro which wraps g_list_free_full() 43/116143/1
authorWook Song <wook16.song@samsung.com>
Thu, 23 Feb 2017 05:37:09 +0000 (14:37 +0900)
committerWook Song <wook16.song@samsung.com>
Thu, 23 Feb 2017 05:37:09 +0000 (14:37 +0900)
This patch adds a macro which wraps g_list_free_full(). This functions
frees all the dynamically-allocated data in the GList element so that we
can use it to clean up GLists well.

Change-Id: I2fd538f39620ca1044b5ba3046a8a82a8bd598c4
Signed-off-by: Wook Song <wook16.song@samsung.com>
src/core/list.h

index c57452a140cd675d95a9c4cf9d49612fb31658c9..261ce4f936204591f86cf2c40a14484b63c26cfb 100644 (file)
@@ -38,6 +38,8 @@ typedef GList dd_list;
        g_list_find(a, (gpointer)b)
 #define DD_LIST_FREE_LIST(a)        \
        g_list_free(a)
+#define DD_LIST_FREE_LIST_FULL(a, free_func)   \
+       g_list_free_full(a, free_func)
 #define DD_LIST_SORT(a, func)          \
        a = g_list_sort(a, func)
 #define DD_LIST_FOREACH(head, elem, node)      \