From d59c81bf1bb04f547f593cc3e25c96088f16e078 Mon Sep 17 00:00:00 2001 From: aemony Date: Thu, 25 Jan 2024 23:01:37 +0100 Subject: [PATCH] Corrected some bugs/oversights --- include/utility/utility.h | 4 ++-- src/utility/utility.cpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/utility/utility.h b/include/utility/utility.h index feb38be4..eb8ac09c 100644 --- a/include/utility/utility.h +++ b/include/utility/utility.h @@ -185,7 +185,7 @@ struct SKIF_DirectoryWatch void reset (void); - HANDLE _hChangeNotification = INVALID_HANDLE_VALUE; + HANDLE _hChangeNotification = INVALID_HANDLE_VALUE; // If the FindFirstChangeNotification function fails, the return value is INVALID_HANDLE_VALUE. UITab _waitTab = UITab_None; std::wstring _path = L""; @@ -225,6 +225,6 @@ struct SKIF_RegistryWatch { } _init; HKEY _hKeyBase = { }; - HANDLE _hEvent = INVALID_HANDLE_VALUE; + HANDLE _hEvent = NULL; // If the CreateEvent function fails, the return value is NULL. UITab _waitTab = UITab_None; }; \ No newline at end of file diff --git a/src/utility/utility.cpp b/src/utility/utility.cpp index b193a1e4..e2cbede6 100644 --- a/src/utility/utility.cpp +++ b/src/utility/utility.cpp @@ -3016,6 +3016,9 @@ SKIF_RegistryWatch::reset (void) bool SKIF_RegistryWatch::isSignaled (void) { + if (_hEvent == NULL) + return false; + bool signaled = WaitForSingleObjectEx ( _hEvent, 0UL, FALSE