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:
parent
efff6b874a
commit
9366a1b4d8
@ -1665,7 +1665,9 @@ static void init_fonts(int pick_width, int pick_height)
|
||||
|
||||
ReleaseDC(hwnd, hdc);
|
||||
|
||||
DestroyIcon(trust_icon);
|
||||
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;
|
||||
}
|
||||
|
||||
DestroyIcon(trust_icon);
|
||||
if (trust_icon != INVALID_HANDLE_VALUE) {
|
||||
DestroyIcon(trust_icon);
|
||||
}
|
||||
trust_icon = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user