mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 13:34:53 +00:00
[MSPAINT] Fix handle leaks about memory bitmap
This fixes CORE-18919. CORE-18867
This commit is contained in:
parent
bfc6a119c5
commit
a9284b5664
|
@ -164,7 +164,7 @@ VOID CCanvasWindow::DoDraw(HDC hDC, RECT& rcClient, RECT& rcPaint)
|
||||||
rcPaint.right - rcPaint.left, rcPaint.bottom - rcPaint.top,
|
rcPaint.right - rcPaint.left, rcPaint.bottom - rcPaint.top,
|
||||||
hdcMem, rcPaint.left, rcPaint.top, SRCCOPY);
|
hdcMem, rcPaint.left, rcPaint.top, SRCCOPY);
|
||||||
|
|
||||||
::SelectObject(hdcMem, hbmOld);
|
::DeleteObject(::SelectObject(hdcMem, hbmOld));
|
||||||
::DeleteDC(hdcMem);
|
::DeleteDC(hdcMem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ LRESULT CPaletteWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
|
||||||
/* Transfer bits (hDC <-- hMemDC) */
|
/* Transfer bits (hDC <-- hMemDC) */
|
||||||
::BitBlt(hDC, 0, 0, rcClient.right, rcClient.bottom, hMemDC, 0, 0, SRCCOPY);
|
::BitBlt(hDC, 0, 0, rcClient.right, rcClient.bottom, hMemDC, 0, 0, SRCCOPY);
|
||||||
|
|
||||||
::SelectObject(hMemDC, hbmOld);
|
::DeleteObject(::SelectObject(hMemDC, hbmOld));
|
||||||
::DeleteDC(hMemDC);
|
::DeleteDC(hMemDC);
|
||||||
EndPaint(&ps);
|
EndPaint(&ps);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue