From 5cdd8a2a4889f3f2556e57e020ba2a3eb5ff3142 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 5 Oct 2009 15:18:10 +0200 Subject: [PATCH] user32: Don't use a static dc for icon blitting. --- dlls/user32/cursoricon.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index a74b79d33d5..fca04ce299f 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -674,10 +674,7 @@ static BOOL stretch_blt_icon(HBITMAP hDest, BITMAPINFO *pDestInfo, BITMAPINFO *p { HBITMAP hOld; BOOL res = FALSE; - static HDC hdcMem = NULL; - - if (!hdcMem) - hdcMem = CreateCompatibleDC(screen_dc); + HDC hdcMem = CreateCompatibleDC(screen_dc); if (hdcMem) { @@ -687,6 +684,7 @@ static BOOL stretch_blt_icon(HBITMAP hDest, BITMAPINFO *pDestInfo, BITMAPINFO *p 0, 0, pSrcInfo->bmiHeader.biWidth, pSrcInfo->bmiHeader.biHeight, pSrcBits, pSrcInfo, DIB_RGB_COLORS, SRCCOPY); SelectObject(hdcMem, hOld); + DeleteDC( hdcMem ); } return res;