From 80967e88ad71b4017b4c47d9b0b52a653bacd01e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 6 Nov 2020 15:32:49 +0100 Subject: [PATCH] utils: add function to clean hook list --- spa/include/spa/utils/hook.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spa/include/spa/utils/hook.h b/spa/include/spa/utils/hook.h index 63bf50255..ef063c866 100644 --- a/spa/include/spa/utils/hook.h +++ b/spa/include/spa/utils/hook.h @@ -112,6 +112,13 @@ static inline void spa_hook_remove(struct spa_hook *hook) hook->removed(hook); } +static inline void spa_hook_list_clean(struct spa_hook_list *list) +{ + struct spa_hook *h; + spa_list_consume(h, &list->list, link) + spa_hook_remove(h); +} + static inline void spa_hook_list_isolate(struct spa_hook_list *list, struct spa_hook_list *save,