diff --git a/daemon/aux.h b/daemon/aux.h index 5a2aace6c..9c7b17fb3 100644 --- a/daemon/aux.h +++ b/daemon/aux.h @@ -90,6 +90,12 @@ GList *g_list_link(GList *, GList *); INLINE int g_hash_table_contains(GHashTable *h, const void *k) { return g_hash_table_lookup(h, k) ? 1 : 0; } +INLINE void g_queue_free_full(GQueue *q, GDestroyNotify free_func) { + void *d; + while ((d = g_queue_pop_head(q))) + free_func(d); + g_queue_free(q); +} #endif