Browse Source

Proper Resource Cleanup in WIN_UpdateWindowShape

mask is created but never deleted if SetWindowRgn() fails. This may lead to resource leaks.
ImThour 2 months ago
parent
commit
7aba6c4c73
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/video/windows/SDL_windowsshape.c

+ 1 - 0
src/video/windows/SDL_windowsshape.c

@@ -116,6 +116,7 @@ bool WIN_UpdateWindowShape(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surfa
         }
     }
     if (!SetWindowRgn(data->hwnd, mask, TRUE)) {
+        DeleteObject(mask);
         return WIN_SetError("SetWindowRgn failed");
     }
     return true;