diff --git a/lib/containers.h b/lib/containers.h index f87673052..19f3d83e8 100644 --- a/lib/containers.h +++ b/lib/containers.h @@ -220,6 +220,9 @@ static inline void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) { } \ static inline void type_name##_q_clear(type_name##_q *q) { \ g_queue_clear(&q->q); \ + } \ + static inline void type_name##_q_free(type_name##_q *q) { \ + g_queue_free(&q->q); \ } #define TYPED_GQUEUE_INIT { .q = G_QUEUE_INIT } diff --git a/recording-daemon/types.h b/recording-daemon/types.h index 7071b7b35..8d3e2cfda 100644 --- a/recording-daemon/types.h +++ b/recording-daemon/types.h @@ -136,11 +136,11 @@ struct tag_s { typedef struct tag_s tag_t; -INLINE void str_q_free(str_q *q) { +INLINE void allocd_str_q_free(str_q *q) { t_queue_clear_full(q, str_free); t_queue_free(q); } -TYPED_GHASHTABLE(metadata_ht, str, str_q, str_hash, str_equal, str_free, str_q_free) +TYPED_GHASHTABLE(metadata_ht, str, str_q, str_hash, str_equal, str_free, allocd_str_q_free) struct metafile_s {