https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f3d1d380412dada010053…
commit f3d1d380412dada010053165ec5070907b41d10c
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sun Jun 16 21:54:44 2019 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Jun 16 23:11:03 2019 +0200
[INPUT] Don't race the system to free an imagelist
---
dll/cpl/input/settings_page.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/dll/cpl/input/settings_page.c b/dll/cpl/input/settings_page.c
index 72260a8bee8..8c093986475 100644
--- a/dll/cpl/input/settings_page.c
+++ b/dll/cpl/input/settings_page.c
@@ -226,7 +226,8 @@ OnInitSettingsPage(HWND hwndDlg)
ILC_COLOR8 | ILC_MASK, 0, 0);
if (hLayoutImageList != NULL)
{
- ListView_SetImageList(hwndInputList, hLayoutImageList, LVSIL_SMALL);
+ HIMAGELIST hOldImagelist = ListView_SetImageList(hwndInputList,
hLayoutImageList, LVSIL_SMALL);
+ ImageList_Destroy(hOldImagelist);
}
UpdateInputListView(hwndInputList);
@@ -239,18 +240,9 @@ OnInitSettingsPage(HWND hwndDlg)
static VOID
OnDestroySettingsPage(HWND hwndDlg)
{
- HIMAGELIST hImageList;
-
LayoutList_Destroy();
LocaleList_Destroy();
InputList_Destroy();
-
- hImageList = ListView_GetImageList(GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST),
- LVSIL_SMALL);
- if (hImageList != NULL)
- {
- ImageList_Destroy(hImageList);
- }
}