diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index a62036184a9..04c93c1bfb9 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -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); diff --git a/dlls/gdi32/tests/dib.c b/dlls/gdi32/tests/dib.c index b431adde91e..f4ed8e17aba 100644 --- a/dlls/gdi32/tests/dib.c +++ b/dlls/gdi32/tests/dib.c @@ -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); diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index e6bab5d04d2..e4413dba981 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -2489,7 +2489,6 @@ todo_wine hemf = CloseEnhMetaFile(hdc); DeleteEnhMetaFile(hemf); DeleteObject(hrgn); - DeleteDC(hdc); } static const unsigned char MF_CLIP_BITS[] = {