diff --git a/Partypacker/MainWindow.xaml.cs b/Partypacker/MainWindow.xaml.cs index 2b6b9ea..47a0593 100644 --- a/Partypacker/MainWindow.xaml.cs +++ b/Partypacker/MainWindow.xaml.cs @@ -38,6 +38,7 @@ namespace Partypacker InitializeComponent(); InitializeRPC(); Application.Current.Exit += OnApplicationExit; + Process.GetCurrentProcess().Exited += MainWindow_Exited; var DiscordURL = PartypackServer.GET("/api/discord/url"); if (!DiscordURL.Key) @@ -53,6 +54,11 @@ namespace Partypacker AutoLogin(); } + private void MainWindow_Exited(object? sender, EventArgs e) + { + Proxx?.StopProxy(); + } + void OnApplicationExit(object sender, ExitEventArgs e) => Proxx?.StopProxy(); void OnChangePort(object sender, TextChangedEventArgs e) { if (!int.TryParse(((TextBox)sender).Text, out int P)) @@ -177,6 +183,7 @@ namespace Partypacker }); WaitingForGameToOpen = true; GameCheckTimer.Stop(); + Proxx?.StopProxy(); } async void OnLaunch(object sender, RoutedEventArgs e)