Skip to content

Commit

Permalink
Fix closing key even if it doesn't open successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
make-42 committed May 13, 2023
1 parent c6f3c87 commit 8a41e35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/picotorrent/core/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ bool Configuration::IsSystemDarkMode()
if (RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
{
RegQueryValueEx(hKey, TEXT("AppsUseLightTheme"), NULL, NULL, (LPBYTE)&dwValue, &dwBufSize);
RegCloseKey(hKey);
}
RegCloseKey(hKey);
if (dwValue == 0)
{
systemUsesDarkTheme = true;
Expand Down

0 comments on commit 8a41e35

Please sign in to comment.