diff --git a/shadowsocks-csharp/Program.cs b/shadowsocks-csharp/Program.cs index 35a27ae9..0f19adca 100755 --- a/shadowsocks-csharp/Program.cs +++ b/shadowsocks-csharp/Program.cs @@ -43,7 +43,6 @@ namespace Shadowsocks SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.ApplicationExit += (sender, args) => HotKeys.Destroy(); if (!mutex.WaitOne(0, false)) { @@ -150,6 +149,7 @@ namespace Shadowsocks private static void Application_ApplicationExit(object sender, EventArgs e) { + HotKeys.Destroy(); if (_controller != null) { _controller.Stop();