mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
protocol-native: remove destroyed client from client list
When the client destroys the protocol-native module, the server and the client are destroyed but the client is still reffed (not freed). It will be unreffed after its messages are processed, after which point it will be freed and removed from the server client_list that is already destroyed. Fix this by removing the client from the server list when it is destroyed. See #565
This commit is contained in:
parent
d506781619
commit
211abaef5e
1 changed files with 8 additions and 2 deletions
|
|
@ -440,14 +440,19 @@ error:
|
|||
goto done;
|
||||
}
|
||||
|
||||
static void client_destroy(void *data)
|
||||
{
|
||||
struct client_data *this = data;
|
||||
pw_log_debug("%p: destroy", this);
|
||||
spa_list_remove(&this->protocol_link);
|
||||
}
|
||||
|
||||
static void client_free(void *data)
|
||||
{
|
||||
struct client_data *this = data;
|
||||
struct pw_impl_client *client = this->client;
|
||||
|
||||
pw_log_debug("%p: free", this);
|
||||
spa_list_remove(&this->protocol_link);
|
||||
|
||||
spa_hook_remove(&this->client_listener);
|
||||
|
||||
if (this->source)
|
||||
|
|
@ -460,6 +465,7 @@ static void client_free(void *data)
|
|||
|
||||
static const struct pw_impl_client_events client_events = {
|
||||
PW_VERSION_IMPL_CLIENT_EVENTS,
|
||||
.destroy = client_destroy,
|
||||
.free = client_free,
|
||||
.busy_changed = client_busy_changed,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue