diff options
author | Patrick Lerda <patrick9876@free.fr> | 2023-03-13 13:02:10 +0100 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-03-20 21:12:54 +0000 |
commit | 84762bb1cfe458000e63c30147de33c925f2c016 (patch) | |
tree | 29fb383f2cb70bc42a37c7ab0dc9b50dcd47c588 /src/glx | |
parent | 19b89c80777b647da0393cc62c69eba6b12e0c4e (diff) | |
download | mesa-84762bb1cfe458000e63c30147de33c925f2c016.tar.gz |
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>
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/glxext.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 4b3496b5a14..b0c51caa40c 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -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(); } |