xlib: clear currentDpy when releasing the current context

After abe6d750e5, glXDestroyContext() can defer destruction by marking
the context with xid == None while it is still current.

However, the release-current path did not clear current->currentDpy,
so a context that had already been marked for deletion could remain
associated with a display after unbinding.

Fixes: abe6d750e5 ("xlib: fix glXDestroyContext in Gallium frontends")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14947
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40422>
This commit is contained in:
Mixie 2026-03-14 20:31:22 +03:00 committed by Marge Bot
parent cec1024b22
commit 447a1d2e8d

View file

@ -1236,6 +1236,8 @@ glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
}
else if (!ctx && !draw && !read) {
/* release current context w/out assigning new one. */
if (current)
current->currentDpy = NULL;
XMesaMakeCurrent2( NULL, NULL, NULL );
SetCurrentContext(NULL);
return True;