[gnome-control-center/wip/benzea/ci: 15/28] network/net-vpn: Fix disconnecting of connection_removed_cb handler
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/benzea/ci: 15/28] network/net-vpn: Fix disconnecting of connection_removed_cb handler
- Date: Mon, 28 May 2018 22:14:53 +0000 (UTC)
commit f8265144dbc39fa21fda2af2ee793f2f55d42211
Author: Benjamin Berg <bberg redhat com>
Date: Thu May 24 18:14:50 2018 +0200
network/net-vpn: Fix disconnecting of connection_removed_cb handler
The disconnect was for the wrong object (connection rather than client).
Fix this by simply moving to use g_signal_connect_object which obsoletes
the explicit disconnect calls.
panels/network/net-vpn.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/panels/network/net-vpn.c b/panels/network/net-vpn.c
index 920db0773..490cfee46 100644
--- a/panels/network/net-vpn.c
+++ b/panels/network/net-vpn.c
@@ -112,14 +112,14 @@ net_vpn_set_connection (NetVpn *vpn, NMConnection *connection)
priv->connection = g_object_ref (connection);
client = net_object_get_client (NET_OBJECT (vpn));
- g_signal_connect (client,
+ g_signal_connect_object (client,
NM_CLIENT_CONNECTION_REMOVED,
G_CALLBACK (connection_removed_cb),
- vpn);
- g_signal_connect (connection,
+ vpn, 0);
+ g_signal_connect_object (connection,
NM_CONNECTION_CHANGED,
G_CALLBACK (connection_changed_cb),
- vpn);
+ vpn, 0);
priv->service_type = net_vpn_connection_to_type (priv->connection);
}
@@ -384,12 +384,6 @@ net_vpn_finalize (GObject *object)
g_object_unref (priv->active_connection);
}
- g_signal_handlers_disconnect_by_func (priv->connection,
- connection_removed_cb,
- vpn);
- g_signal_handlers_disconnect_by_func (priv->connection,
- connection_changed_cb,
- vpn);
g_object_unref (priv->connection);
g_free (priv->service_type);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]