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.
This commit is contained in:
Ken Thomases 2014-03-23 22:45:44 -05:00 committed by Alexandre Julliard
parent e5e8677666
commit 03ca2b2932
1 changed files with 2 additions and 3 deletions

View File

@ -884,13 +884,12 @@ static void context_update_window(struct wined3d_context *context)
TRACE("Updating context %p window from %p to %p.\n",
context, context->win_handle, context->swapchain->win_handle);
if (context->valid)
if (context->hdc)
wined3d_release_dc(context->win_handle, context->hdc);
else
context->valid = 1;
context->win_handle = context->swapchain->win_handle;
context->needs_set = 1;
context->valid = 1;
if (!(context->hdc = GetDC(context->win_handle)))
{