Browse Source

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")
(cherry picked from commit 8e96d47cd3d94213da52277678d844ef616d08a2)
Barnabás Pőcze 2 years ago
parent
commit
0f4d0eed25
1 changed files with 2 additions and 0 deletions
  1. 2 0
      libobs-opengl/gl-x11-egl.c

+ 2 - 0
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);
 	gl_context_destroy(plat);
 	eglTerminate(plat->edisplay);
 	eglTerminate(plat->edisplay);
+	if (plat->close_xdisplay)
+		XCloseDisplay(plat->xdisplay);
 	bfree(plat);
 	bfree(plat);
 }
 }