diff --git a/src/x11_init.c b/src/x11_init.c index 0913c1a8..256e4122 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -605,17 +605,6 @@ static Cursor createNULLCursor(void) return _glfwCreateCursor(&image, 0, 0); } -// Terminate X11 display -// -static void terminateDisplay(void) -{ - if (_glfw.x11.display) - { - XCloseDisplay(_glfw.x11.display); - _glfw.x11.display = NULL; - } -} - // X error handler // static int errorHandler(Display *display, XErrorEvent* event) @@ -734,7 +723,12 @@ void _glfwPlatformTerminate(void) _glfwTerminateJoysticks(); _glfwTerminateContextAPI(); - terminateDisplay(); + + if (_glfw.x11.display) + { + XCloseDisplay(_glfw.x11.display); + _glfw.x11.display = NULL; + } } const char* _glfwPlatformGetVersionString(void)