Commit 446bff78 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32/tests: Avoid deleting invalid objects.

parent 9351867e
......@@ -3523,7 +3523,6 @@ static void test_GdiAlphaBlend(void)
HDC hdcNull;
HDC hdcDst;
HBITMAP bmpDst;
HBITMAP oldDst;
BITMAPINFO *bmi;
HDC hdcSrc;
HBITMAP bmpSrc;
......@@ -3553,7 +3552,7 @@ static void test_GdiAlphaBlend(void)
bmpSrc = CreateDIBSection(hdcDst, bmi, DIB_RGB_COLORS, &bits, NULL, 0);
ok(bmpSrc != NULL, "Couldn't create source bitmap\n");
oldDst = SelectObject(hdcDst, bmpDst);
SelectObject(hdcDst, bmpDst);
oldSrc = SelectObject(hdcSrc, bmpSrc);
blend.BlendOp = AC_SRC_OVER;
......@@ -3736,12 +3735,10 @@ static void test_GdiAlphaBlend(void)
ok( !ret, "GdiAlphaBlend succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
SelectObject(hdcDst, oldDst);
SelectObject(hdcSrc, oldSrc);
DeleteObject(bmpSrc);
DeleteObject(bmpDst);
DeleteDC(hdcDst);
DeleteDC(hdcSrc);
DeleteObject(bmpSrc);
DeleteObject(bmpDst);
ReleaseDC(NULL, hdcNull);
......
......@@ -1904,6 +1904,7 @@ static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits)
DeleteObject(bmp);
SelectObject(hdc, orig_brush);
DeleteObject( dib_brush );
SetBrushOrgEx(hdc, 0, 0, NULL);
SetTextColor(hdc, old_text);
SetBkColor(hdc, old_bkgnd);
......@@ -2656,7 +2657,6 @@ static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits)
SelectObject(hdc, orig_brush);
SelectObject(hdc, orig_pen);
DeleteObject(dib_brush);
DeleteObject(solid_brush);
DeleteObject(wide_pen);
DeleteObject(dashed_pen);
......
......@@ -2489,7 +2489,6 @@ todo_wine
hemf = CloseEnhMetaFile(hdc);
DeleteEnhMetaFile(hemf);
DeleteObject(hrgn);
DeleteDC(hdc);
}
static const unsigned char MF_CLIP_BITS[] = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment