mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
monitor: safely remove pending requests
This commit is contained in:
parent
63ce244c79
commit
ae905530ba
1 changed files with 18 additions and 10 deletions
|
|
@ -75,15 +75,22 @@ static void add_pending(struct proxy_data *pd)
|
||||||
pw_core_proxy_sync(d->core_proxy, pd->pending_seq);
|
pw_core_proxy_sync(d->core_proxy, pd->pending_seq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void remove_pending(struct proxy_data *pd)
|
||||||
|
{
|
||||||
|
if (pd->pending_seq != SPA_ID_INVALID) {
|
||||||
|
spa_list_remove(&pd->pending_link);
|
||||||
|
pd->pending_seq = SPA_ID_INVALID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void on_sync_reply(void *data, uint32_t seq)
|
static void on_sync_reply(void *data, uint32_t seq)
|
||||||
{
|
{
|
||||||
struct data *d = data;
|
struct data *d = data;
|
||||||
struct proxy_data *pd;
|
struct proxy_data *pd, *t;
|
||||||
|
|
||||||
spa_list_for_each(pd, &d->pending_list, pending_link) {
|
spa_list_for_each_safe(pd, t, &d->pending_list, pending_link) {
|
||||||
if (pd->pending_seq == seq) {
|
if (pd->pending_seq == seq) {
|
||||||
spa_list_remove(&pd->pending_link);
|
remove_pending(pd);
|
||||||
pd->pending_seq = SPA_ID_INVALID;
|
|
||||||
pd->print_func(pd);
|
pd->print_func(pd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -439,16 +446,17 @@ static const struct pw_link_proxy_events link_events = {
|
||||||
static void
|
static void
|
||||||
destroy_proxy (void *data)
|
destroy_proxy (void *data)
|
||||||
{
|
{
|
||||||
struct proxy_data *user_data = data;
|
struct proxy_data *pd = data;
|
||||||
|
|
||||||
clear_params(user_data);
|
clear_params(pd);
|
||||||
|
remove_pending(pd);
|
||||||
|
|
||||||
if (user_data->info == NULL)
|
if (pd->info == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (user_data->destroy)
|
if (pd->destroy)
|
||||||
user_data->destroy(user_data->info);
|
pd->destroy(pd->info);
|
||||||
user_data->info = NULL;
|
pd->info = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pw_proxy_events proxy_events = {
|
static const struct pw_proxy_events proxy_events = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue