diff --git a/src/egl_context.c b/src/egl_context.c index b9403dee4..ddfcf5eb2 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -500,11 +500,13 @@ int _glfwCreateContext(_GLFWwindow* window, // void _glfwDestroyContext(_GLFWwindow* window) { + int test = 1; #if defined(_GLFW_X11) // NOTE: Do not unload libGL.so.1 while the X11 display is still open, // as it will make XCloseDisplay segfault - if (window->context.api != GLFW_OPENGL_API) + test = window->context.api != GLFW_OPENGL_API; #endif // _GLFW_X11 + if (test) { if (window->context.egl.client) {