[KBM] Fix for handle leak (#11182)

This commit is contained in:
Enrico Giordani
2021-05-10 01:39:54 -07:00
committed by GitHub
parent 489ff37bf4
commit 617b7adb09
2 changed files with 13 additions and 3 deletions

View File

@@ -9,7 +9,15 @@ class KeyboardManager
public:
// Constructor
KeyboardManager();
~KeyboardManager()
{
if (editorIsRunningEvent)
{
CloseHandle(editorIsRunningEvent);
}
}
void StartLowlevelKeyboardHook();
void StopLowlevelKeyboardHook();
@@ -38,6 +46,8 @@ private:
std::atomic_bool loadingSettings = false;
HANDLE editorIsRunningEvent = nullptr;
// Hook procedure definition
static LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam);