mirror of
https://gitlab.gnome.org/GNOME/libgnome-volume-control.git
synced 2024-11-21 08:20:40 -05:00
mixer-control: Fix extra reference being leaked
In both cases objects are inserted in hash table by adding an extra ref, but the existing reference was never removed. Don't add a reference instead, so we don't end up with a spare one. Based on patch by Alberts Muktupāvels <alberts.muktupavels@gmail.com> https://bugzilla.gnome.org/show_bug.cgi?id=765694
This commit is contained in:
parent
25bf3ed75f
commit
d52194fce1
@ -1955,7 +1955,7 @@ create_ui_device_from_port (GvcMixerControl* control,
|
|||||||
|
|
||||||
g_hash_table_insert (is_card_port_an_output (port) ? control->priv->ui_outputs : control->priv->ui_inputs,
|
g_hash_table_insert (is_card_port_an_output (port) ? control->priv->ui_outputs : control->priv->ui_inputs,
|
||||||
GUINT_TO_POINTER (gvc_mixer_ui_device_get_id (uidevice)),
|
GUINT_TO_POINTER (gvc_mixer_ui_device_get_id (uidevice)),
|
||||||
g_object_ref (uidevice));
|
uidevice);
|
||||||
|
|
||||||
|
|
||||||
if (available) {
|
if (available) {
|
||||||
@ -2478,7 +2478,7 @@ update_card (GvcMixerControl *control,
|
|||||||
if (is_new) {
|
if (is_new) {
|
||||||
g_hash_table_insert (control->priv->cards,
|
g_hash_table_insert (control->priv->cards,
|
||||||
GUINT_TO_POINTER (info->index),
|
GUINT_TO_POINTER (info->index),
|
||||||
g_object_ref (card));
|
card);
|
||||||
}
|
}
|
||||||
|
|
||||||
card_ports = gvc_mixer_card_get_ports (card);
|
card_ports = gvc_mixer_card_get_ports (card);
|
||||||
|
Loading…
Reference in New Issue
Block a user