Quellcode durchsuchen

Always destroy icon

Yufei Huang vor 4 Jahren
Ursprung
Commit
881f747d5c
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2 1
      src/video/windows/SDL_windowsmouse.c

+ 2 - 1
src/video/windows/SDL_windowsmouse.c

@@ -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
     /* The cursor returned by CreateIconIndirect does not respect system cursor size
         preference, use CopyImage to duplicate the cursor with desired sizes */
         preference, use CopyImage to duplicate the cursor with desired sizes */
     hcursor = CopyImage(hicon, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE);
     hcursor = CopyImage(hicon, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE);
+    DestroyIcon(hicon);
+
     if (!hcursor) {
     if (!hcursor) {
-        DestroyIcon(hicon);
         WIN_SetError("CopyImage()");
         WIN_SetError("CopyImage()");
         return NULL;
         return NULL;
     }
     }