Fix hotkey dispose

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
This commit is contained in:
Syrone Wong
2016-09-30 15:15:48 +08:00
parent 6e8d6d3d21
commit c46149a375
+7 -2
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;