From 93fd4c12f8834a0c5ca3e166b999388b36bde218 Mon Sep 17 00:00:00 2001 From: Vitaliy Margolen Date: Mon, 29 May 2006 14:51:33 -0600 Subject: [PATCH] wined3d: Properly destroy texture object if we failed to create its surfaces. --- dlls/wined3d/device.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index a9dc6b427cd..70ac58defd4 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -843,14 +843,10 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, UINT Wid /* use the callback to create the texture surface */ hr = D3DCB_CreateSurface(This->parent, tmpW, tmpH, Format, Usage, Pool, i, &object->surfaces[i],NULL); if (hr!= WINED3D_OK || ( (IWineD3DSurfaceImpl *) object->surfaces[i])->Flags & SFLAG_OVERSIZE) { - int j; FIXME("Failed to create surface %p\n", object); /* clean up */ - for (j = 0 ; j <= i ; j++) { - if(object->surfaces[j]) IWineD3DSurface_Release(object->surfaces[j]); - } - /* heap free object */ - HeapFree(GetProcessHeap(), 0, object); + object->surfaces[i] = NULL; + IWineD3DTexture_Release((IWineD3DTexture *)object); *ppTexture = NULL; return hr; -- 2.11.4.GIT