Always destroy icon

This commit is contained in:
Yufei Huang authored and Sam Lantinga committed 2021-11-08 22:20:50 -08:00
1 parent 7fea557b99
commit 881f747d5c
1 file changed
+2 -1
+2 -1
View File
@@ -154,8 +154,9 @@ WIN_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y)
/* The cursor returned by CreateIconIndirect does not respect system cursor size
preference, use CopyImage to duplicate the cursor with desired sizes */
hcursor = CopyImage(hicon, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE);
DestroyIcon(hicon);
if (!hcursor) {
DestroyIcon(hicon);
WIN_SetError("CopyImage()");
return NULL;
}