From 6d0075b4e9062f93034c3d5254261ebed513cf21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Mon, 31 Jan 2022 17:30:40 +0100 Subject: [PATCH] pulse-server: client: cancel related work queue jobs --- src/modules/module-protocol-pulse/client.c | 2 ++ src/modules/module-protocol-pulse/pulse-server.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/module-protocol-pulse/client.c b/src/modules/module-protocol-pulse/client.c index dff7af9a0..77e9ffc22 100644 --- a/src/modules/module-protocol-pulse/client.c +++ b/src/modules/module-protocol-pulse/client.c @@ -174,6 +174,8 @@ void client_free(struct client *client) pw_map_clear(&client->streams); + pw_work_queue_cancel(impl->work_queue, client, SPA_ID_INVALID); + free(client->default_sink); free(client->default_source); diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index d58fcc2b3..2b82308a2 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -857,7 +857,7 @@ static void manager_metadata(void *data, struct pw_manager_object *o, static void do_free_client(void *obj, void *data, int res, uint32_t id) { - struct client *client = data; + struct client *client = obj; client_free(client); } @@ -865,8 +865,8 @@ static void manager_disconnect(void *data) { struct client *client = data; pw_log_debug("manager_disconnect()"); - pw_work_queue_add(client->impl->work_queue, NULL, 0, - do_free_client, client); + pw_work_queue_add(client->impl->work_queue, client, 0, + do_free_client, NULL); } static const struct pw_manager_events manager_events = {