pulse-server: cancel items from work-queue

Make sure we cancel any pending work-queue items for the object before
we destroy the object.
This commit is contained in:
Wim Taymans 2021-04-21 13:23:13 +02:00
parent 639e6ea644
commit fbd6a62b73

View file

@ -970,6 +970,8 @@ static void stream_free(struct stream *stream)
spa_hook_remove(&stream->stream_listener);
pw_stream_destroy(stream->stream);
}
pw_work_queue_cancel(impl->work_queue, stream, SPA_ID_INVALID);
if (stream->buffer)
free(stream->buffer);
if (stream->props)
@ -2640,8 +2642,11 @@ struct pending_sample {
static void pending_sample_free(struct pending_sample *ps)
{
struct client *client = ps->client;
struct impl *impl = client->impl;
spa_list_remove(&ps->link);
spa_hook_remove(&ps->listener);
pw_work_queue_cancel(impl->work_queue, ps, SPA_ID_INVALID);
ps->client->ref--;
sample_play_destroy(ps->play);
}