mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
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:
parent
194c0f9c99
commit
1bf00720e3
1 changed files with 1 additions and 3 deletions
|
|
@ -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)
|
||||
{
|
||||
struct stream *stream = obj;
|
||||
struct client *client = stream->client;
|
||||
|
||||
stream_free(stream);
|
||||
if (client->ref <= 0)
|
||||
client_free(client);
|
||||
}
|
||||
|
||||
static void stream_state_changed(void *data, enum pw_stream_state old,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue