[gnome-control-center] Network: fix a refcounting bug with vpn settings



commit ea5f76247df74591527740777f1df8e711caae93
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Mar 15 21:07:51 2011 -0400

    Network: fix a refcounting bug with vpn settings
    
    nm_connection_get_setting_by_name() does not return a reference,
    so we have to get one ourselves.

 panels/network/net-vpn.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/panels/network/net-vpn.c b/panels/network/net-vpn.c
index db3a1b0..d245ba2 100644
--- a/panels/network/net-vpn.c
+++ b/panels/network/net-vpn.c
@@ -66,7 +66,7 @@ net_vpn_set_connection (NetVpn *vpn, NMConnection *connection)
                                   G_CALLBACK (connection_state_changed_cb),
                                   vpn);
         }
-        priv->setting = NM_SETTING_VPN (nm_connection_get_setting_by_name (connection, "vpn"));
+        priv->setting = NM_SETTING_VPN (g_object_ref (nm_connection_get_setting_by_name (connection, "vpn")));
 }
 
 NMConnection *



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