[PATCH weston] gl-renderer: Fix an invalid write when closing a Weston window

Dima Ryazanov dima at gmail.com
Thu Nov 24 02:41:00 UTC 2016


Call eglMakeCurrent before destroying the native EGL window, similar to what
other sample clients are already doing.

Signed-off-by: Dima Ryazanov <dima at gmail.com>
---
 libweston/gl-renderer.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
index d08bfd0..c6091af 100644
--- a/libweston/gl-renderer.c
+++ b/libweston/gl-renderer.c
@@ -2760,6 +2760,10 @@ gl_renderer_output_destroy(struct weston_output *output)
 	for (i = 0; i < 2; i++)
 		pixman_region32_fini(&go->buffer_damage[i]);
 
+	eglMakeCurrent(gr->egl_display,
+		       EGL_NO_SURFACE, EGL_NO_SURFACE,
+		       EGL_NO_CONTEXT);
+
 	weston_platform_destroy_egl_surface(gr->egl_display, go->egl_surface);
 
 	free(go);
-- 
2.9.3



More information about the wayland-devel mailing list