diff options
Diffstat (limited to 'libnm/nm-vpn-service-plugin.c')
| -rw-r--r-- | libnm/nm-vpn-service-plugin.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/libnm/nm-vpn-service-plugin.c b/libnm/nm-vpn-service-plugin.c index abd02f18..a2201428 100644 --- a/libnm/nm-vpn-service-plugin.c +++ b/libnm/nm-vpn-service-plugin.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,6 +26,7 @@ #include <stdlib.h> #include "nm-glib-aux/nm-secret-utils.h" +#include "nm-glib-aux/nm-dbus-aux.h" #include "nm-enum-types.h" #include "nm-utils.h" #include "nm-connection.h" @@ -499,16 +499,11 @@ watch_peer (NMVpnServicePlugin *plugin, GDBusConnection *connection = g_dbus_method_invocation_get_connection (context); const char *peer = g_dbus_message_get_sender (g_dbus_method_invocation_get_message (context)); - return g_dbus_connection_signal_subscribe (connection, - "org.freedesktop.DBus", - "org.freedesktop.DBus", - "NameOwnerChanged", - "/org/freedesktop/DBus", - peer, - G_DBUS_SIGNAL_FLAGS_NONE, - peer_vanished, - plugin, - NULL); + return nm_dbus_connection_signal_subscribe_name_owner_changed (connection, + peer, + peer_vanished, + plugin, + NULL); } static void @@ -1190,11 +1185,8 @@ state_changed (NMVpnServicePlugin *plugin, NMVpnServiceState state) nm_vpn_service_plugin_emit_quit (plugin); else schedule_quit_timer (plugin); - if (priv->peer_watch_id) { - g_dbus_connection_signal_unsubscribe (nm_vpn_service_plugin_get_connection (plugin), - priv->peer_watch_id); - priv->peer_watch_id = 0; - } + nm_clear_g_dbus_connection_signal (nm_vpn_service_plugin_get_connection (plugin), + &priv->peer_watch_id); break; default: /* Clean up all timers we might have set up. */ |