loop: clean polling flag when leaving the loop

When we leave the last recursive enter of the loop, clear the polling
flag.

It might be possible that it was not cleared because the loop might have
been killed with pthread_kill. In any case, the _leave calls need to be
made in this case as well.

This fixes issues when jack clients stop because it triggers and assert
because the polling flag is still active when the object is cleared.

See !1171
This commit is contained in:
Wim Taymans 2022-03-07 10:27:22 +01:00
parent dcbaed1251
commit 54933b67fd

View file

@ -348,8 +348,10 @@ static void loop_leave(void *object)
spa_log_trace(impl->log, "%p: leave %lu", impl, impl->thread);
if (--impl->enter_count == 0)
if (--impl->enter_count == 0) {
impl->thread = 0;
impl->polling = false;
}
}
static inline void free_source(struct source_impl *s)