loop: free tss from the thread calling impl::clear

The thread that calls the impl_clear method might be the main thread and
is certainly not going to call the invoke function anymore so free the
tss if there is any.

Fixes a leak in the unit test.
This commit is contained in:
Wim Taymans 2024-10-02 09:18:14 +02:00
parent 75566a238f
commit 5d3aac313d

View file

@ -1101,6 +1101,9 @@ static int impl_clear(struct spa_handle *handle)
spa_list_consume(queue, &impl->queue_list, link)
loop_queue_destroy(queue);
/* free the tss from this thread if any */
free(tss_get(impl->queue_tss_id));
spa_system_close(impl->system, impl->poll_fd);
pthread_mutex_destroy(&impl->queue_lock);
tss_delete(impl->queue_tss_id);