Author: gadamopoulos
Date: Mon May 1 13:40:57 2017
New Revision: 74440
URL:
http://svn.reactos.org/svn/reactos?rev=74440&view=rev
Log:
[COMCTL32] -ImageList: Don't leak the DC returned by saturate_image.
Modified:
trunk/reactos/dll/win32/comctl32/imagelist.c
Modified: trunk/reactos/dll/win32/comctl32/imagelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/imageli…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] Mon May 1 13:40:57 2017
@@ -1444,6 +1444,9 @@
HBRUSH hOldBrush;
POINT pt;
BOOL has_alpha;
+#ifdef __REACTOS__
+ HDC hdcSaturated;
+#endif
if (!pimldp || !(himl = pimldp->himl)) return FALSE;
if (!is_valid(himl)) return FALSE;
@@ -1500,9 +1503,10 @@
*/
if (fState & ILS_SATURATE)
{
- hImageListDC = saturate_image(himl, pimldp->hdcDst, pimldp->x,
pimldp->y,
+ hdcSaturated = saturate_image(himl, pimldp->hdcDst, pimldp->x,
pimldp->y,
pt.x, pt.y, cx, cy, pimldp->rgbFg);
+ hImageListDC = hdcSaturated;
/* shitty way of getting subroutines to blit at the right place (top left
corner),
as our modified imagelist only contains a single image for performance reasons
*/
pt.x = 0;
@@ -1672,6 +1676,10 @@
SetTextColor(hImageDC, oldImageFg);
SelectObject(hImageDC, hOldImageBmp);
cleanup:
+#ifdef __REACTOS__
+ if (hdcSaturated)
+ DeleteDC(hdcSaturated);
+#endif
DeleteObject(hBlendMaskBmp);
DeleteObject(hImageBmp);
DeleteDC(hImageDC);