[gnome-control-center/gnome-3-14] network: Fix reference leak of NetProxy



commit 777152534191145dad599d1a7b7edf3a40ef8afc
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Mar 18 18:59:24 2015 +0100

    network: Fix reference leak of NetProxy
    
    Every time we got the list of devices from the devices GtkListStore, we
    were leaking the only element that wasn't a NetDevice, the proxy page.
    Make sure to unref' it by hand if we're not going to add it to the list
    (the elements of which will be unref'ed properly).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746411

 panels/network/cc-network-panel.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 711aa09..6a8e249 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -513,6 +513,8 @@ cc_network_panel_get_devices (CcNetworkPanel *panel)
                                     -1);
                 if (NET_IS_DEVICE (object))
                         g_ptr_array_add (devices, object);
+                else
+                        g_object_unref (object);
         } while (gtk_tree_model_iter_next (model, &iter));
 
         return devices;


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