1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Don't call DestroyIcon(INVALID_HANDLE_VALUE).

The Windows API documentation doesn't explicitly say this is safe, and
ea32967044 didn't take care over it.
This commit is contained in:
Jacob Nevins 2019-03-31 23:47:03 +01:00
parent efff6b874a
commit 9366a1b4d8

View File

@ -1665,7 +1665,9 @@ static void init_fonts(int pick_width, int pick_height)
ReleaseDC(hwnd, hdc);
if (trust_icon != INVALID_HANDLE_VALUE) {
DestroyIcon(trust_icon);
}
trust_icon = LoadImage(hinst, MAKEINTRESOURCE(IDI_MAINICON),
IMAGE_ICON, font_width*2, font_height,
LR_DEFAULTCOLOR);
@ -1753,7 +1755,9 @@ static void deinit_fonts(void)
fontflag[i] = false;
}
if (trust_icon != INVALID_HANDLE_VALUE) {
DestroyIcon(trust_icon);
}
trust_icon = INVALID_HANDLE_VALUE;
}