Use DeleteDC instead of DeleteObject to free HDCs (spotted by Dietrich

Teickner <Dietrich_Teickner@t-online.de>).
Clear the imagelist structure on deletion, as some stupid apps free
imagelists multiple times.
This commit is contained in:
Dimitrie O. Paun 2002-11-18 19:45:22 +00:00 committed by Alexandre Julliard
parent 27faf02e0b
commit 0fe326c499
1 changed files with 4 additions and 3 deletions

View File

@ -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;
}