Fix GDI leak.
Patch by mudhead.
CORE-7854 #resolve #comment Fixed in revision 62498, thanks ;)

svn path=/trunk/; revision=62498
This commit is contained in:
Hermès Bélusca-Maïto 2014-03-14 23:12:10 +00:00
parent 4314bf948d
commit 7c7bd121c5

View file

@ -169,13 +169,15 @@ BOOL WINAPI cdtDrawExt(HDC hdc, INT x, INT y, INT dx, INT dy, INT card, INT type
if (type == ectEMPTY || type == ectERASE) if (type == ectEMPTY || type == ectERASE)
{ {
POINT pPoint; POINT pPoint;
HBRUSH hBrush; HBRUSH hBrush, hOldBrush;
hBrush = CreateSolidBrush(color); hBrush = CreateSolidBrush(color);
GetDCOrgEx(hdc, &pPoint); GetDCOrgEx(hdc, &pPoint);
SetBrushOrgEx(hdc, pPoint.x, pPoint.y, 0); SetBrushOrgEx(hdc, pPoint.x, pPoint.y, 0);
SelectObject(hdc, hBrush); hOldBrush = SelectObject(hdc, hBrush);
PatBlt(hdc, x, y, dx, dy, PATCOPY); PatBlt(hdc, x, y, dx, dy, PATCOPY);
SelectObject(hdc, hOldBrush);
DeleteObject(hBrush);
} }
if (type != ectERASE) if (type != ectERASE)
{ {