gdiplus/tests: Fix resource leaks in several tests.
authorAndrew Eikum <andrew@brightnightgames.com>
Thu, 25 Jun 2009 13:40:28 +0000 (08:40 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 26 Jun 2009 12:38:13 +0000 (14:38 +0200)
A few tests initialized two GpGraphics objects, and only released one.
These have been fixed by removing the redundant initialization.

dlls/gdiplus/tests/graphics.c

index 668d261..68c0e29 100644 (file)
@@ -243,8 +243,6 @@ static void test_GdipDrawArc(void)
     HDC hdc = GetDC(0);
 
     /* make a graphics object and pen object */
-    status = GdipCreateFromHDC(hdc, &graphics);
-    expect(Ok, status);
     ok(hdc != NULL, "Expected HDC to be initialized\n");
 
     status = GdipCreateFromHDC(hdc, &graphics);
@@ -289,8 +287,6 @@ static void test_GdipDrawArcI(void)
     HDC hdc = GetDC(0);
 
     /* make a graphics object and pen object */
-    status = GdipCreateFromHDC(hdc, &graphics);
-    expect(Ok, status);
     ok(hdc != NULL, "Expected HDC to be initialized\n");
 
     status = GdipCreateFromHDC(hdc, &graphics);
@@ -335,8 +331,6 @@ static void test_GdipDrawBezierI(void)
     HDC hdc = GetDC(0);
 
     /* make a graphics object and pen object */
-    status = GdipCreateFromHDC(hdc, &graphics);
-    expect(Ok, status);
     ok(hdc != NULL, "Expected HDC to be initialized\n");
 
     status = GdipCreateFromHDC(hdc, &graphics);
@@ -436,8 +430,6 @@ static void test_GdipDrawLineI(void)
     HDC hdc = GetDC(0);
 
     /* make a graphics object and pen object */
-    status = GdipCreateFromHDC(hdc, &graphics);
-    expect(Ok, status);
     ok(hdc != NULL, "Expected HDC to be initialized\n");
 
     status = GdipCreateFromHDC(hdc, &graphics);
@@ -477,8 +469,6 @@ static void test_GdipDrawLinesI(void)
     HDC hdc = GetDC(0);
 
     /* make a graphics object and pen object */
-    status = GdipCreateFromHDC(hdc, &graphics);
-    expect(Ok, status);
     ok(hdc != NULL, "Expected HDC to be initialized\n");
 
     status = GdipCreateFromHDC(hdc, &graphics);