Module: wine Branch: master Commit: 665fa81a511f94f97b62f074959e07a25ea7d307 URL: https://source.winehq.org/git/wine.git/?a=commit;h=665fa81a511f94f97b62f0749...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Mon Mar 1 11:10:02 2021 +0800
comdlg32: Fix a memory leak.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/comdlg32/colordlg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/comdlg32/colordlg.c b/dlls/comdlg32/colordlg.c index 7ab5efd0962..d5254736b24 100644 --- a/dlls/comdlg32/colordlg.c +++ b/dlls/comdlg32/colordlg.c @@ -523,6 +523,7 @@ static void CC_PaintCross(CCPRIV *infoPtr) int wc = GetDialogBaseUnits() * 3 / 4; RECT rect; POINT point, p; + HRGN region; HPEN hPen; int x, y;
@@ -531,7 +532,9 @@ static void CC_PaintCross(CCPRIV *infoPtr)
GetClientRect(hwnd, &rect); hDC = GetDC(hwnd); - SelectClipRgn( hDC, CreateRectRgnIndirect(&rect)); + region = CreateRectRgnIndirect(&rect); + SelectClipRgn(hDC, region); + DeleteObject(region);
point.x = ((long)rect.right * (long)x) / (long)MAXHORI; point.y = rect.bottom - ((long)rect.bottom * (long)y) / (long)MAXVERT;