Browse Source

Fix hotkey dispose

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
tags/3.3.2
Syrone Wong 8 years ago
parent
commit
c46149a375
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      shadowsocks-csharp/Util/Hotkeys.cs

+ 7
- 2
shadowsocks-csharp/Util/Hotkeys.cs View File

@@ -22,7 +22,11 @@ namespace Shadowsocks.Util
_hotKeyManager.KeyPressed += HotKeyManagerPressed;
}
public static void Destroy() => _hotKeyManager.Dispose();
public static void Destroy()
{
_hotKeyManager.KeyPressed -= HotKeyManagerPressed;
_hotKeyManager.Dispose();
}
private static void HotKeyManagerPressed(object sender, KeyPressedEventArgs e)
{
@@ -79,7 +83,8 @@ namespace Shadowsocks.Util
}
}
public static HotKey Str2HotKey( string s ) {
public static HotKey Str2HotKey(string s)
{
try
{
if (s.IsNullOrEmpty()) return null;


Loading…
Cancel
Save