Evas GDI engine: save the original bitmap into the memory DC

This allows the memory DC to be killed and fix a memory leak

@fix
This commit is contained in:
Vincent Torri 2015-07-23 09:52:31 +02:00 committed by Tom Hacohen
parent ff6dbb17e3
commit 07af170bd8
1 changed files with 13 additions and 10 deletions

View File

@ -59,18 +59,21 @@ evas_software_gdi_output_buffer_paste(Gdi_Output_Buffer *gdiob,
int y) int y)
{ {
HDC dc; HDC dc;
HGDIOBJ obj;
dc = CreateCompatibleDC(gdiob->dc); dc = CreateCompatibleDC(gdiob->dc);
if (!dc) if (dc)
return; {
SelectObject(dc, gdiob->bitmap); obj = SelectObject(dc, gdiob->bitmap);
BitBlt(gdiob->dc, BitBlt(gdiob->dc,
x, y, x, y,
gdiob->width, gdiob->height, gdiob->width, gdiob->height,
dc, dc,
0, 0, 0, 0,
SRCCOPY); SRCCOPY);
DeleteDC(dc); SelectObject(dc, obj);
DeleteDC(dc);
}
} }
DATA8 * DATA8 *