wined3d: Don't leak the context array in the swapchain_init() error path.

This commit is contained in:
Henri Verbeet 2010-01-19 23:52:25 +01:00 committed by Alexandre Julliard
parent b4448d9b77
commit ee1f2c4654
1 changed files with 8 additions and 3 deletions

View File

@ -913,10 +913,15 @@ err:
HeapFree(GetProcessHeap(), 0, swapchain->backBuffer);
}
if (swapchain->context && swapchain->context[0])
if (swapchain->context)
{
context_release(swapchain->context[0]);
context_destroy(device, swapchain->context[0]);
if (swapchain->context[0])
{
context_release(swapchain->context[0]);
context_destroy(device, swapchain->context[0]);
swapchain->num_contexts = 0;
}
HeapFree(GetProcessHeap(), 0, swapchain->context);
}
if (swapchain->frontBuffer) IWineD3DSurface_Release(swapchain->frontBuffer);