spa: support: loop: assert loop is not polling when source is removed

`spa_source`s whose backing storage is not managed by the loop
cannot be safely removed while the loop is polling.
Assert that it does not happen.
This commit is contained in:
Barnabás Pőcze 2022-03-04 16:53:26 +01:00 committed by Wim Taymans
parent 60b9d9081b
commit 616519d704

View file

@ -155,7 +155,10 @@ static int remove_from_poll(struct impl *impl, struct spa_source *source)
static int loop_remove_source(void *object, struct spa_source *source) static int loop_remove_source(void *object, struct spa_source *source)
{ {
int res = remove_from_poll(object, source); struct impl *impl = object;
spa_assert(!impl->polling);
int res = remove_from_poll(impl, source);
detach_source(source); detach_source(source);
return res; return res;