ddraw/tests: Properly cleanup on failed device creation in a couple of places.

This commit is contained in:
Henri Verbeet 2012-05-23 18:14:31 +02:00 committed by Alexandre Julliard
parent 89d561e6f8
commit fa90a256d7
2 changed files with 8 additions and 0 deletions

View File

@ -1158,6 +1158,7 @@ static void test_ck_rgba(void)
if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
{ {
skip("Failed to create D3D device, skipping test.\n"); skip("Failed to create D3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
DestroyWindow(window); DestroyWindow(window);
return; return;
} }
@ -1390,6 +1391,7 @@ static void test_surface_qi(void)
if (!(ddraw = create_ddraw())) if (!(ddraw = create_ddraw()))
{ {
skip("Failed to create a ddraw object, skipping test.\n"); skip("Failed to create a ddraw object, skipping test.\n");
DestroyWindow(window);
return; return;
} }
/* Try to create a D3D device to see if the ddraw implementation supports /* Try to create a D3D device to see if the ddraw implementation supports
@ -1398,6 +1400,7 @@ static void test_surface_qi(void)
if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
{ {
skip("Failed to create D3D device, skipping test.\n"); skip("Failed to create D3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
DestroyWindow(window); DestroyWindow(window);
return; return;
} }
@ -1483,6 +1486,7 @@ static void test_device_qi(void)
if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
{ {
skip("Failed to create D3D device, skipping test.\n"); skip("Failed to create D3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
DestroyWindow(window); DestroyWindow(window);
return; return;
} }

View File

@ -1373,6 +1373,7 @@ static void test_ck_rgba(void)
if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
{ {
skip("Failed to create D3D device, skipping test.\n"); skip("Failed to create D3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
DestroyWindow(window); DestroyWindow(window);
return; return;
} }
@ -1586,6 +1587,7 @@ static void test_surface_qi(void)
if (!(ddraw = create_ddraw())) if (!(ddraw = create_ddraw()))
{ {
skip("Failed to create a ddraw object, skipping test.\n"); skip("Failed to create a ddraw object, skipping test.\n");
DestroyWindow(window);
return; return;
} }
/* Try to create a D3D device to see if the ddraw implementation supports /* Try to create a D3D device to see if the ddraw implementation supports
@ -1594,6 +1596,7 @@ static void test_surface_qi(void)
if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
{ {
skip("Failed to create D3D device, skipping test.\n"); skip("Failed to create D3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
DestroyWindow(window); DestroyWindow(window);
return; return;
} }
@ -1678,6 +1681,7 @@ static void test_device_qi(void)
if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
{ {
skip("Failed to create D3D device, skipping test.\n"); skip("Failed to create D3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
DestroyWindow(window); DestroyWindow(window);
return; return;
} }