Zhiyi Zhang : comdlg32: Fix a memory leak.
Alexandre Julliard
julliard at winehq.org
Mon Mar 1 15:54:04 CST 2021
Module: wine
Branch: master
Commit: 665fa81a511f94f97b62f074959e07a25ea7d307
URL: https://source.winehq.org/git/wine.git/?a=commit;h=665fa81a511f94f97b62f074959e07a25ea7d307
Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date: Mon Mar 1 11:10:02 2021 +0800
comdlg32: Fix a memory leak.
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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;
More information about the wine-cvs
mailing list