Added step to dispose the keyboard hook object (#4449)

This commit is contained in:
Arjun Balgovind
2020-06-23 17:19:36 -07:00
committed by GitHub
parent ca99f60964
commit 2104a1250e
3 changed files with 21 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ using interop;
namespace Microsoft.PowerToys.Settings.UI.Lib
{
public delegate void KeyEvent(int key);
public delegate bool IsActive();
public class HotkeySettingsControlHook
@@ -49,5 +49,11 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
break;
}
}
public void Dispose()
{
// Dispose the KeyboardHook object to terminate the hook threads
hook.Dispose();
}
}
}