summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2015-03-18 18:59:24 +0100
committerBastien Nocera <hadess@hadess.net>2015-03-19 16:32:45 +0100
commit2cf597eb973d3a3692467129cb45be9dec4381b3 (patch)
tree45568d219554e12c969f9580b89aa83864ba9683
parenta6781932e96822f4f9f94d3d0087d9bb47a42a37 (diff)
downloadgnome-control-center-2cf597eb973d3a3692467129cb45be9dec4381b3.tar.gz
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
-rw-r--r--panels/network/cc-network-panel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 830eebe1d..4edae7a68 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -502,6 +502,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;