Commit 03ca2b29 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

wined3d: Don't leak the HDC of an invalid context in context_update_window().

If context_set_gl_context() fails, it marks the context as invalid. It still has an HDC, though, and context_update_window() would lose the reference to it.
parent e5e86776
...@@ -884,13 +884,12 @@ static void context_update_window(struct wined3d_context *context) ...@@ -884,13 +884,12 @@ static void context_update_window(struct wined3d_context *context)
TRACE("Updating context %p window from %p to %p.\n", TRACE("Updating context %p window from %p to %p.\n",
context, context->win_handle, context->swapchain->win_handle); context, context->win_handle, context->swapchain->win_handle);
if (context->valid) if (context->hdc)
wined3d_release_dc(context->win_handle, context->hdc); wined3d_release_dc(context->win_handle, context->hdc);
else
context->valid = 1;
context->win_handle = context->swapchain->win_handle; context->win_handle = context->swapchain->win_handle;
context->needs_set = 1; context->needs_set = 1;
context->valid = 1;
if (!(context->hdc = GetDC(context->win_handle))) if (!(context->hdc = GetDC(context->win_handle)))
{ {
......
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