Merge pull request #51 from justanotheranonymoususer/RegCloseKey-fix

Fixing RegCloseKey invalid handle
This commit is contained in:
Valentin-Gabriel Radu
2021-10-10 19:24:12 +03:00
committed by GitHub
+5 -1
View File
@@ -723,6 +723,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
if (hKey)
{
RegCloseKey(hKey);
hKey = NULL;
RegDeleteKeyExW(
HKEY_CURRENT_USER,
wcschr(section, L'\\') + 1,
@@ -799,7 +800,10 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
}
InvalidateRect(hwnd, NULL, FALSE);
}
RegCloseKey(hKey);
if (hKey)
{
RegCloseKey(hKey);
}
if (bChoice)
{
for (unsigned int i = 0; i < numChoices; ++i)