From 235b155b75f7764767c986136e1b90c22a5d93ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sat, 5 Mar 2022 22:00:18 +0100 Subject: [PATCH] spa: support: loop: assert loop is not polling when destroyed Assert that the loop is not polling when `impl_clear()` is called. --- spa/plugins/support/loop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spa/plugins/support/loop.c b/spa/plugins/support/loop.c index 9f013f21a..ef52c32bf 100644 --- a/spa/plugins/support/loop.c +++ b/spa/plugins/support/loop.c @@ -853,6 +853,8 @@ static int impl_clear(struct spa_handle *handle) spa_log_warn(impl->log, "%p: loop is entered %d times", impl, impl->enter_count); + spa_assert(!impl->polling); + spa_list_consume(source, &impl->source_list, link) loop_destroy_source(impl, &source->source);