Skip to content

Commit 16908dc

Browse files
Fix icon leak
1 parent ecccf27 commit 16908dc

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

graphics.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ prepare_window(uint32_t width, uint32_t height, const char *iconFile)
9191
hIcon = (HICON)LoadImageA(NULL, iconFile, IMAGE_ICON, 256, 256, LR_LOADFROMFILE);
9292
if (!hIcon) {
9393
logmsg("Failed to load icon from %s: %d\n", iconFile, GetLastError());
94+
} else {
95+
DeleteFileA(iconFile);
9496
}
9597
}
9698

0 commit comments

Comments
 (0)