From 0fe326c499ffd672b5b4255df96b48436cc4707c Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Mon, 18 Nov 2002 19:45:22 +0000 Subject: [PATCH] Use DeleteDC instead of DeleteObject to free HDCs (spotted by Dietrich Teickner ). Clear the imagelist structure on deletion, as some stupid apps free imagelists multiple times. --- dlls/comctl32/imagelist.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index 40fdd8566c7..662e9f479eb 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -694,6 +694,7 @@ ImageList_Destroy (HIMAGELIST himl) if (himl->hbrBlend50) DeleteObject (himl->hbrBlend50); + ZeroMemory(himl, sizeof(*himl)); COMCTL32_Free (himl); return TRUE; @@ -1223,9 +1224,9 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp) cleanup: DeleteObject(hBlendMaskBmp); DeleteObject(hImageBmp); - DeleteObject(hImageDC); - DeleteObject(hImageListDC); - DeleteObject(hMaskListDC); + DeleteDC(hImageDC); + DeleteDC(hImageListDC); + DeleteDC(hMaskListDC); return bResult; }