Commit 77a12259 authored by Benjamin Berg's avatar Benjamin Berg

network: Fix disconnecting the VPN 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.
parent 52034ba0
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment