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)