diff options
author | Grant Limberg <grant.limberg@zerotier.com> | 2016-11-18 14:23:22 -0800 |
---|---|---|
committer | Grant Limberg <grant.limberg@zerotier.com> | 2016-11-18 14:23:22 -0800 |
commit | a8847de910e4da6327c24078300015e0cedb9cf5 (patch) | |
tree | e0530e2cdb40f3ecbe54922f117048179391fdb6 | |
parent | 2231e878d5470d86f4c6543cc708dc78661da462 (diff) | |
download | infinitytier-a8847de910e4da6327c24078300015e0cedb9cf5.tar.gz infinitytier-a8847de910e4da6327c24078300015e0cedb9cf5.zip |
proper shutdown
-rw-r--r-- | windows/WinUI/NetworkMonitor.cs | 5 | ||||
-rw-r--r-- | windows/WinUI/ToolbarItem.xaml.cs | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/windows/WinUI/NetworkMonitor.cs b/windows/WinUI/NetworkMonitor.cs index 7adfe0bf..4877d34c 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 4d063714..de45b607 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) |