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:
Bastien Nocera 2017-04-06 14:34:51 +02:00
parent 25bf3ed75f
commit d52194fce1

View File

@ -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,
GUINT_TO_POINTER (gvc_mixer_ui_device_get_id (uidevice)),
g_object_ref (uidevice));
uidevice);
if (available) {
@ -2478,7 +2478,7 @@ update_card (GvcMixerControl *control,
if (is_new) {
g_hash_table_insert (control->priv->cards,
GUINT_TO_POINTER (info->index),
g_object_ref (card));
card);
}
card_ports = gvc_mixer_card_get_ports (card);