mirror of
https://gitlab.gnome.org/GNOME/libgnome-volume-control.git
synced 2024-11-21 08:20:40 -05:00
mixer-control: fix gvc_mixer_card_set_profiles API usage
In update_card, profile_list is incorrectly used also after its ownership is transferred to the GvcMixerCard. In practice, this causes e.g. some profiles to go missing due to the list head being clobbered. Fix this by calling gvc_mixer_card_set_profiles only after profiles_list is no longer used for any other purpose.
This commit is contained in:
parent
c5ab6037f4
commit
8e7a5a4c3e
@ -2590,7 +2590,6 @@ update_card (GvcMixerControl *control,
|
||||
}
|
||||
card = gvc_mixer_card_new (control->priv->pa_context,
|
||||
info->index);
|
||||
gvc_mixer_card_set_profiles (card, profile_list);
|
||||
|
||||
for (i = 0; i < info->n_ports; i++) {
|
||||
GvcMixerCardPort *port;
|
||||
@ -2604,6 +2603,8 @@ update_card (GvcMixerControl *control,
|
||||
port->profiles = determine_profiles_for_port (info->ports[i], profile_list);
|
||||
port_list = g_list_prepend (port_list, port);
|
||||
}
|
||||
|
||||
gvc_mixer_card_set_profiles (card, profile_list);
|
||||
gvc_mixer_card_set_ports (card, port_list);
|
||||
is_new = TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user