Commit 29a2594b authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wined3d: Don't leak the device context on failure in context_create().

parent 4c1d6d27
...@@ -1456,7 +1456,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, ...@@ -1456,7 +1456,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
unsigned int s; unsigned int s;
int swap_interval; int swap_interval;
DWORD state; DWORD state;
HDC hdc; HDC hdc = 0;
BOOL hdc_is_private = FALSE; BOOL hdc_is_private = FALSE;
TRACE("swapchain %p, target %p, window %p.\n", swapchain, target, swapchain->win_handle); TRACE("swapchain %p, target %p, window %p.\n", swapchain, target, swapchain->win_handle);
...@@ -1837,6 +1837,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, ...@@ -1837,6 +1837,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
return ret; return ret;
out: out:
if (hdc) wined3d_release_dc(swapchain->win_handle, hdc);
device->shader_backend->shader_free_context_data(ret); device->shader_backend->shader_free_context_data(ret);
device->adapter->fragment_pipe->free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret);
HeapFree(GetProcessHeap(), 0, ret->free_event_queries); HeapFree(GetProcessHeap(), 0, ret->free_event_queries);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment