diff options
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS/AppDelegate.swift')
-rw-r--r-- | WireGuard/WireGuard/UI/macOS/AppDelegate.swift | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift index 76ac000..5546eef 100644 --- a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift +++ b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift @@ -40,6 +40,12 @@ class AppDelegate: NSObject, NSApplicationDelegate { self.statusItemController = statusItemController } } + + func applicationWillTerminate(_ notification: Notification) { + if let currentTunnel = tunnelsTracker?.currentTunnel { + tunnelsManager?.startDeactivation(of: currentTunnel) + } + } } extension AppDelegate: StatusMenuWindowDelegate { |