From a8847de910e4da6327c24078300015e0cedb9cf5 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Fri, 18 Nov 2016 14:23:22 -0800 Subject: [PATCH] proper shutdown --- windows/WinUI/NetworkMonitor.cs | 5 +++++ windows/WinUI/ToolbarItem.xaml.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/windows/WinUI/NetworkMonitor.cs b/windows/WinUI/NetworkMonitor.cs index 7adfe0bf3..4877d34ca 100644 --- a/windows/WinUI/NetworkMonitor.cs +++ b/windows/WinUI/NetworkMonitor.cs @@ -188,5 +188,10 @@ namespace WinUI } } } + + public void StopMonitor() + { + runThread.Abort(); + } } } diff --git a/windows/WinUI/ToolbarItem.xaml.cs b/windows/WinUI/ToolbarItem.xaml.cs index 4d0637148..de45b6071 100644 --- a/windows/WinUI/ToolbarItem.xaml.cs +++ b/windows/WinUI/ToolbarItem.xaml.cs @@ -175,9 +175,9 @@ namespace WinUI private void ToolbarItem_QuitClicked(object sender, System.EventArgs e) { + NetworkMonitor.Instance.StopMonitor(); this.Close(); Application.Current.Shutdown(); - Environment.Exit(0); } private void ToolbarItem_NetworkClicked(object sender, System.Windows.RoutedEventArgs e)