[MSPAINT] Fix handle leaks about memory bitmap

This fixes CORE-18919. CORE-18867
This commit is contained in:
Katayama Hirofumi MZ 2023-04-09 11:15:51 +09:00
parent bfc6a119c5
commit a9284b5664
2 changed files with 2 additions and 2 deletions

View file

@ -164,7 +164,7 @@ VOID CCanvasWindow::DoDraw(HDC hDC, RECT& rcClient, RECT& rcPaint)
rcPaint.right - rcPaint.left, rcPaint.bottom - rcPaint.top,
hdcMem, rcPaint.left, rcPaint.top, SRCCOPY);
::SelectObject(hdcMem, hbmOld);
::DeleteObject(::SelectObject(hdcMem, hbmOld));
::DeleteDC(hdcMem);
}

View file

@ -121,7 +121,7 @@ LRESULT CPaletteWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
/* Transfer bits (hDC <-- hMemDC) */
::BitBlt(hDC, 0, 0, rcClient.right, rcClient.bottom, hMemDC, 0, 0, SRCCOPY);
::SelectObject(hMemDC, hbmOld);
::DeleteObject(::SelectObject(hMemDC, hbmOld));
::DeleteDC(hMemDC);
EndPaint(&ps);
return 0;