[libgnome-volume-control] mixer-control: Fix extra reference being leaked



commit d52194fce13f4b477afc997ff752233aa6886cbf
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Apr 6 14:34:51 2017 +0200

    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

 gvc-mixer-control.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gvc-mixer-control.c b/gvc-mixer-control.c
index 760b05d..7b49456 100644
--- a/gvc-mixer-control.c
+++ b/gvc-mixer-control.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]