pulse-server: do not manage client lifetime during stream cleanup

A stream's lifetime is tied to that of the client, it cannot outlive
the client object. Streams also do not increase the client's reference
count. It is not possible for a stream to exist after the corresponding
client has been destroyed.

Hence it is not necessary to manage the client's reference count
or lifetime in `do_destroy_stream()`. All works related to a particular
stream are cancelled in `stream_free()`, which is called
before the client is destroyed.
This commit is contained in:
Barnabás Pőcze 2022-01-30 15:44:48 +01:00 committed by Wim Taymans
parent 194c0f9c99
commit 1bf00720e3

View file

@ -973,10 +973,8 @@ static void stream_control_info(void *data, uint32_t id,
static void do_destroy_stream(void *obj, void *data, int res, uint32_t id) static void do_destroy_stream(void *obj, void *data, int res, uint32_t id)
{ {
struct stream *stream = obj; struct stream *stream = obj;
struct client *client = stream->client;
stream_free(stream); stream_free(stream);
if (client->ref <= 0)
client_free(client);
} }
static void stream_state_changed(void *data, enum pw_stream_state old, static void stream_state_changed(void *data, enum pw_stream_state old,