Hans Leidekker : wined3d: Don' t leak the device context on failure in context_create().
Module: wine Branch: master Commit: 29a2594b7f3c216156bc1a266065710f614edc98 URL: http://source.winehq.org/git/wine.git/?a=commit;h=29a2594b7f3c216156bc1a2660... Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jan 27 13:38:04 2016 +0100 wined3d: Don't leak the device context on failure in context_create(). Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index dabb5fd..490c20f 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1456,7 +1456,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, unsigned int s; int swap_interval; DWORD state; - HDC hdc; + HDC hdc = 0; BOOL hdc_is_private = FALSE; 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, return ret; out: + if (hdc) wined3d_release_dc(swapchain->win_handle, hdc); device->shader_backend->shader_free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret); HeapFree(GetProcessHeap(), 0, ret->free_event_queries);
participants (1)
-
Alexandre Julliard