From 8e96d47cd3d94213da52277678d844ef616d08a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sat, 21 Jan 2023 05:13:47 +0100 Subject: [PATCH] libobs-opengl: Close display when destroying X11/EGL platform Currently, the X11 display may be leaked when the X11/EGL platform is destroyed. Fix that by calling XCloseDisplay() to free it. Fixes: 2fd8a6df557766 ("libobs-opengl: Introduce the X11/EGL winsys") --- libobs-opengl/gl-x11-egl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libobs-opengl/gl-x11-egl.c b/libobs-opengl/gl-x11-egl.c index fd5c1f3f2..56086a997 100644 --- a/libobs-opengl/gl-x11-egl.c +++ b/libobs-opengl/gl-x11-egl.c @@ -385,6 +385,8 @@ static void gl_x11_egl_platform_destroy(struct gl_platform *plat) gl_context_destroy(plat); eglTerminate(plat->edisplay); + if (plat->close_xdisplay) + XCloseDisplay(plat->xdisplay); bfree(plat); }