From 5d525c4a5f9da0b8744f29affbf77d3a9580905c Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 21 Aug 2014 21:18:02 +0200 Subject: [PATCH] Moved display closing into _glfwPlatformTerminate. --- src/x11_init.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) 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)