Skip to content

Commit

Permalink
Proper Resource Cleanup in WIN_UpdateWindowShape
Browse files Browse the repository at this point in the history
mask is created but never deleted if SetWindowRgn() fails. This may lead to resource leaks.
  • Loading branch information
thouravi authored and slouken committed Feb 10, 2025
1 parent e29ebb9 commit 7aba6c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/video/windows/SDL_windowsshape.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7aba6c4

Please sign in to comment.