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)))
{
skip("Failed to create D3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
DestroyWindow(window);
return;
}
@ -1390,6 +1391,7 @@ static void test_surface_qi(void)
if (!(ddraw = create_ddraw()))
{
skip("Failed to create a ddraw object, skipping test.\n");
DestroyWindow(window);
return;
}
/* 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)))
{
skip("Failed to create D3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
DestroyWindow(window);
return;
}
@ -1483,6 +1486,7 @@ static void test_device_qi(void)
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create D3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
DestroyWindow(window);
return;
}

View File

@ -1373,6 +1373,7 @@ static void test_ck_rgba(void)
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create D3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
DestroyWindow(window);
return;
}
@ -1586,6 +1587,7 @@ static void test_surface_qi(void)
if (!(ddraw = create_ddraw()))
{
skip("Failed to create a ddraw object, skipping test.\n");
DestroyWindow(window);
return;
}
/* 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)))
{
skip("Failed to create D3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
DestroyWindow(window);
return;
}
@ -1678,6 +1681,7 @@ static void test_device_qi(void)
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create D3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
DestroyWindow(window);
return;
}