Browse Source

Fix invalid EGL display being terminated

Camilla Berglund 9 years ago
parent
commit
c234a19423
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/egl_context.c

+ 6 - 1
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;
     }