Commit 2d106a57 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Fix a few GDI memory leaks.

parent 947a74f4
......@@ -2773,13 +2773,13 @@ BOOL WINAPI PathCompactPathW(HDC hDC, LPWSTR lpszPath, UINT dx)
strcpyW(sPath, szEllipses);
strcpyW(sPath+3, buff);
}
if (hdc)
ReleaseDC(0, hdc);
return TRUE;
bRet = TRUE;
goto end;
}
strcpyW(lpszPath, szEllipses);
strcpyW(lpszPath+3, buff);
return FALSE;
bRet = FALSE;
goto end;
}
/* Trim the path by adding ellipses to the end, e.g:
......@@ -2819,6 +2819,7 @@ BOOL WINAPI PathCompactPathW(HDC hDC, LPWSTR lpszPath, UINT dx)
}
}
end:
if (hdc)
ReleaseDC(0, hdc);
......
......@@ -1725,7 +1725,7 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon,
HBRUSH hbr, UINT flags )
{
CURSORICONINFO *ptr = (CURSORICONINFO *)GlobalLock16(HICON_16(hIcon));
HDC hDC_off = 0, hMemDC = CreateCompatibleDC (hdc);
HDC hDC_off = 0, hMemDC;
BOOL result = FALSE, DoOffscreen;
HBITMAP hB_off = 0, hOld = 0;
......@@ -1734,6 +1734,7 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon,
hdc,x0,y0,hIcon,cxWidth,cyWidth,istep,hbr,flags
);
hMemDC = CreateCompatibleDC (hdc);
if (istep)
FIXME_(icon)("Ignoring istep=%d\n", istep);
if (flags & DI_COMPAT)
......
......@@ -2208,7 +2208,7 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam )
BOOL NC_DrawGrayButton(HDC hdc, int x, int y)
{
HBITMAP hMaskBmp;
HDC hdcMask = CreateCompatibleDC (0);
HDC hdcMask;
HBRUSH hOldBrush;
hMaskBmp = CreateBitmap (12, 10, 1, 1, lpGrayMask);
......@@ -2216,6 +2216,7 @@ BOOL NC_DrawGrayButton(HDC hdc, int x, int y)
if(hMaskBmp == 0)
return FALSE;
hdcMask = CreateCompatibleDC (0);
SelectObject (hdcMask, hMaskBmp);
/* Draw the grayed bitmap using the mask */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment