glx: fix memory leak related to __glXCloseDisplay()

Indeed, the unbind function is not called which could lead
to an unbalanced refcount state for the "drawable" object.

For instance, with "piglit/bin/glx-fbo-binding -auto"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22024>
This commit is contained in:
Patrick Lerda 2023-03-13 13:02:10 +01:00 committed by Marge Bot
parent 19b89c8077
commit 84762bb1cf

View file

@ -262,6 +262,9 @@ glx_display_free(struct glx_display *priv)
gc = __glXGetCurrentContext();
if (priv->dpy == gc->currentDpy) {
if (gc != &dummyContext)
gc->vtable->unbind(gc);
gc->vtable->destroy(gc);
__glXSetCurrentContextNull();
}