Fix a handle leak: close registry key in localization.c

- Also call Kill the IDT_STOP_TIMER in StatusDialogFunc. Though timers
  will get destroyed during Window destruction an explicit KillTimer
  in case still running is the "right" thing to do.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
pull/608/head
Selva Nair 2023-01-23 18:54:51 -05:00
parent aaeb8d2700
commit acb5b8f9c8
2 changed files with 4 additions and 0 deletions

View File

@ -97,7 +97,10 @@ GetGUILanguage(void)
LONG status = RegOpenKeyEx(HKEY_CURRENT_USER, GUI_REGKEY_HKCU, 0, KEY_READ, &regkey);
if (status == ERROR_SUCCESS)
{
GetRegistryValueNumeric(regkey, _T("ui_language"), &value);
RegCloseKey(regkey);
}
gui_language = ( value != 0 ? value : GetUserDefaultUILanguage() );
InitMUILanguage(gui_language);

View File

@ -2078,6 +2078,7 @@ StatusDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
return TRUE;
case WM_NCDESTROY:
KillTimer(hwndDlg, IDT_STOP_TIMER);
RemoveProp(hwndDlg, cfgProp);
break;