Commit ab788c7c authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

wgl: Make context not current before deleting it.

parent b86787e5
......@@ -552,6 +552,11 @@ static void test_deletecontext(HDC hdc)
res = wglDeleteContext(hglrc);
ok(res == TRUE, "wglDeleteContext failed\n");
/* WGL makes a context not current when deleting it. This differs from GLX behavior where
* deletion takes place when the thread becomes not current. */
hglrc = wglGetCurrentContext();
ok(hglrc == NULL, "A WGL context is active while none was expected\n");
}
static void test_make_current_read(HDC hdc)
......
......@@ -1783,6 +1783,10 @@ BOOL CDECL X11DRV_wglDeleteContext(HGLRC hglrc)
return FALSE;
}
/* WGL makes a context not current if it is active before deletion. GLX waits until the context is not current. */
if (ctx == NtCurrentTeb()->glContext)
wglMakeCurrent(ctx->hdc, NULL);
if (ctx->ctx)
{
wine_tsx11_lock();
......
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