comdlg32: Fix a memory leak.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-03-01 11:10:02 +08:00 committed by Alexandre Julliard
parent 92a8c69194
commit 665fa81a51
1 changed files with 4 additions and 1 deletions

View File

@ -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;