From cdc9f283fb77738af1e4c3efa47dcd5f3f974edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 22 Oct 2012 17:20:26 +0200 Subject: [PATCH] d3dx9/tests: Only release a texture when it was created. --- dlls/d3dx9_36/tests/texture.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index 3c2cd95aab6..997b0c322d1 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -964,12 +964,12 @@ static void test_D3DXFillTexture(IDirect3DDevice9 *device) } size >>= 1; } + + IDirect3DTexture9_Release(tex); } else skip("Failed to create texture\n"); - IDirect3DTexture9_Release(tex); - hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 1, 0, D3DFMT_A1R5G5B5, D3DPOOL_MANAGED, &tex, NULL); @@ -1006,11 +1006,11 @@ static void test_D3DXFillTexture(IDirect3DDevice9 *device) } IDirect3DTexture9_UnlockRect(tex, 0); } + + IDirect3DTexture9_Release(tex); } else skip("Failed to create texture\n"); - - IDirect3DTexture9_Release(tex); } static void WINAPI fillfunc_cube(D3DXVECTOR4 *value, const D3DXVECTOR3 *texcoord, @@ -1117,12 +1117,12 @@ static void test_D3DXFillCubeTexture(IDirect3DDevice9 *device) } size >>= 1; } + + IDirect3DCubeTexture9_Release(tex); } else skip("Failed to create texture\n"); - IDirect3DCubeTexture9_Release(tex); - hr = IDirect3DDevice9_CreateCubeTexture(device, 4, 1, 0, D3DFMT_A1R5G5B5, D3DPOOL_MANAGED, &tex, NULL); @@ -1162,11 +1162,11 @@ static void test_D3DXFillCubeTexture(IDirect3DDevice9 *device) IDirect3DCubeTexture9_UnlockRect(tex, f, 0); } } + + IDirect3DCubeTexture9_Release(tex); } else skip("Failed to create texture\n"); - - IDirect3DCubeTexture9_Release(tex); } static void WINAPI fillfunc_volume(D3DXVECTOR4 *value, const D3DXVECTOR3 *texcoord, @@ -1232,12 +1232,12 @@ static void test_D3DXFillVolumeTexture(IDirect3DDevice9 *device) } size >>= 1; } + + IDirect3DVolumeTexture9_Release(tex); } else skip("Failed to create texture\n"); - IDirect3DVolumeTexture9_Release(tex); - hr = IDirect3DDevice9_CreateVolumeTexture(device, 4, 4, 4, 1, 0, D3DFMT_A1R5G5B5, D3DPOOL_MANAGED, &tex, NULL); @@ -1277,11 +1277,11 @@ static void test_D3DXFillVolumeTexture(IDirect3DDevice9 *device) } IDirect3DVolumeTexture9_UnlockBox(tex, 0); } + + IDirect3DVolumeTexture9_Release(tex); } else skip("Failed to create texture\n"); - - IDirect3DVolumeTexture9_Release(tex); } static void test_D3DXCreateTextureFromFileInMemory(IDirect3DDevice9 *device)