From c234a1942359dc5f2f7c2b8971bdb43b3bcb8ace Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 29 Mar 2016 11:09:03 +0200 Subject: [PATCH] Fix invalid EGL display being terminated --- src/egl_context.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/egl_context.c b/src/egl_context.c index 74067fc0..26df4566 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -269,9 +269,14 @@ GLFWbool _glfwInitEGL(void) // void _glfwTerminateEGL(void) { - if (_glfw.egl.handle) + if (_glfw.egl.display) { eglTerminate(_glfw.egl.display); + _glfw.egl.display = EGL_NO_DISPLAY; + } + + if (_glfw.egl.handle) + { _glfw_dlclose(_glfw.egl.handle); _glfw.egl.handle = NULL; }