gdi32/tests: Avoid deleting invalid objects.
This commit is contained in:
parent
9351867e6a
commit
446bff7897
|
@ -3523,7 +3523,6 @@ static void test_GdiAlphaBlend(void)
|
||||||
HDC hdcNull;
|
HDC hdcNull;
|
||||||
HDC hdcDst;
|
HDC hdcDst;
|
||||||
HBITMAP bmpDst;
|
HBITMAP bmpDst;
|
||||||
HBITMAP oldDst;
|
|
||||||
BITMAPINFO *bmi;
|
BITMAPINFO *bmi;
|
||||||
HDC hdcSrc;
|
HDC hdcSrc;
|
||||||
HBITMAP bmpSrc;
|
HBITMAP bmpSrc;
|
||||||
|
@ -3553,7 +3552,7 @@ static void test_GdiAlphaBlend(void)
|
||||||
bmpSrc = CreateDIBSection(hdcDst, bmi, DIB_RGB_COLORS, &bits, NULL, 0);
|
bmpSrc = CreateDIBSection(hdcDst, bmi, DIB_RGB_COLORS, &bits, NULL, 0);
|
||||||
ok(bmpSrc != NULL, "Couldn't create source bitmap\n");
|
ok(bmpSrc != NULL, "Couldn't create source bitmap\n");
|
||||||
|
|
||||||
oldDst = SelectObject(hdcDst, bmpDst);
|
SelectObject(hdcDst, bmpDst);
|
||||||
oldSrc = SelectObject(hdcSrc, bmpSrc);
|
oldSrc = SelectObject(hdcSrc, bmpSrc);
|
||||||
|
|
||||||
blend.BlendOp = AC_SRC_OVER;
|
blend.BlendOp = AC_SRC_OVER;
|
||||||
|
@ -3736,12 +3735,10 @@ static void test_GdiAlphaBlend(void)
|
||||||
ok( !ret, "GdiAlphaBlend succeeded\n" );
|
ok( !ret, "GdiAlphaBlend succeeded\n" );
|
||||||
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
|
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
|
||||||
|
|
||||||
SelectObject(hdcDst, oldDst);
|
|
||||||
SelectObject(hdcSrc, oldSrc);
|
|
||||||
DeleteObject(bmpSrc);
|
|
||||||
DeleteObject(bmpDst);
|
|
||||||
DeleteDC(hdcDst);
|
DeleteDC(hdcDst);
|
||||||
DeleteDC(hdcSrc);
|
DeleteDC(hdcSrc);
|
||||||
|
DeleteObject(bmpSrc);
|
||||||
|
DeleteObject(bmpDst);
|
||||||
|
|
||||||
ReleaseDC(NULL, hdcNull);
|
ReleaseDC(NULL, hdcNull);
|
||||||
|
|
||||||
|
|
|
@ -1904,6 +1904,7 @@ static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits)
|
||||||
|
|
||||||
DeleteObject(bmp);
|
DeleteObject(bmp);
|
||||||
SelectObject(hdc, orig_brush);
|
SelectObject(hdc, orig_brush);
|
||||||
|
DeleteObject( dib_brush );
|
||||||
SetBrushOrgEx(hdc, 0, 0, NULL);
|
SetBrushOrgEx(hdc, 0, 0, NULL);
|
||||||
SetTextColor(hdc, old_text);
|
SetTextColor(hdc, old_text);
|
||||||
SetBkColor(hdc, old_bkgnd);
|
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_brush);
|
||||||
SelectObject(hdc, orig_pen);
|
SelectObject(hdc, orig_pen);
|
||||||
DeleteObject(dib_brush);
|
|
||||||
DeleteObject(solid_brush);
|
DeleteObject(solid_brush);
|
||||||
DeleteObject(wide_pen);
|
DeleteObject(wide_pen);
|
||||||
DeleteObject(dashed_pen);
|
DeleteObject(dashed_pen);
|
||||||
|
|
|
@ -2489,7 +2489,6 @@ todo_wine
|
||||||
hemf = CloseEnhMetaFile(hdc);
|
hemf = CloseEnhMetaFile(hdc);
|
||||||
DeleteEnhMetaFile(hemf);
|
DeleteEnhMetaFile(hemf);
|
||||||
DeleteObject(hrgn);
|
DeleteObject(hrgn);
|
||||||
DeleteDC(hdc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const unsigned char MF_CLIP_BITS[] = {
|
static const unsigned char MF_CLIP_BITS[] = {
|
||||||
|
|
Loading…
Reference in New Issue