Module: wine Branch: refs/heads/master Commit: 93fd4c12f8834a0c5ca3e166b999388b36bde218 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=93fd4c12f8834a0c5ca3e166...
Author: Vitaliy Margolen wine-patch@kievinfo.com Date: Mon May 29 14:51:33 2006 -0600
wined3d: Properly destroy texture object if we failed to create its surfaces.
---
dlls/wined3d/device.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index a9dc6b4..70ac58d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -843,14 +843,10 @@ HRESULT WINAPI IWineD3DDeviceImpl_Creat /* 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;