diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2015-10-05 18:40:47 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2015-10-13 18:20:55 +0200 |
commit | 78f263a5fd8e3458feeaaddb179913c7459bd25a (patch) | |
tree | a0f80f437eff4e95e0f1a0b1ae19b2f9d317a3c0 | |
parent | 9f15abbda786c3db0431a3a5cb82baf5bea87660 (diff) | |
download | NetworkManager-78f263a5fd8e3458feeaaddb179913c7459bd25a.tar.gz |
libnm/vpn-service-plugin: quit when the peer we watch disconnects
We're of no use anymore as another user would start an instance with
a different bus name.
-rw-r--r-- | libnm/nm-vpn-service-plugin.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libnm/nm-vpn-service-plugin.c b/libnm/nm-vpn-service-plugin.c index d9f669c9ee..062b26c777 100644 --- a/libnm/nm-vpn-service-plugin.c +++ b/libnm/nm-vpn-service-plugin.c @@ -212,11 +212,6 @@ nm_vpn_service_plugin_disconnect (NMVpnServicePlugin *plugin, GError **err) break; case NM_VPN_SERVICE_STATE_STARTING: case NM_VPN_SERVICE_STATE_STARTED: - 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_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STOPPING); ret = NM_VPN_SERVICE_PLUGIN_GET_CLASS (plugin)->disconnect (plugin, err); nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STOPPED); @@ -1128,7 +1123,15 @@ state_changed (NMVpnServicePlugin *plugin, NMVpnServiceState state) nm_clear_g_source (&priv->fail_stop_id); break; case NM_VPN_SERVICE_STATE_STOPPED: - schedule_quit_timer (plugin); + if (priv->dbus_watch_peer) + 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; + } break; default: /* Clean up all timers we might have set up. */ |