From d7670cf906c06be7f5d0f18ea38cb56e22ad8989 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 15 Sep 2010 02:28:56 +0200 Subject: [PATCH] Moved glfwTerminate window closing to shared code. --- src/init.c | 4 ++++ src/win32/win32_init.c | 3 --- src/x11/x11_init.c | 3 --- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/init.c b/src/init.c index 97551115..0ff2b61f 100644 --- a/src/init.c +++ b/src/init.c @@ -70,6 +70,10 @@ GLFWAPI void glfwTerminate(void) if (!_glfwInitialized) return; + // Close all remaining windows + while (_glfwLibrary.windowListHead) + glfwCloseWindow(_glfwLibrary.windowListHead); + if (!_glfwPlatformTerminate()) return; diff --git a/src/win32/win32_init.c b/src/win32/win32_init.c index a9c17087..488e9d3e 100644 --- a/src/win32/win32_init.c +++ b/src/win32/win32_init.c @@ -178,9 +178,6 @@ int _glfwPlatformInit(void) int _glfwPlatformTerminate(void) { - while (_glfwLibrary.windowListHead) - glfwCloseWindow(_glfwLibrary.windowListHead); - if (_glfwLibrary.Win32.classAtom) { UnregisterClass(_GLFW_WNDCLASSNAME, _glfwLibrary.Win32.instance); diff --git a/src/x11/x11_init.c b/src/x11/x11_init.c index 4c35043e..aaf90a5d 100644 --- a/src/x11/x11_init.c +++ b/src/x11/x11_init.c @@ -220,9 +220,6 @@ int _glfwPlatformInit(void) int _glfwPlatformTerminate(void) { - while (_glfwLibrary.windowListHead) - glfwCloseWindow(_glfwLibrary.windowListHead); - if (_glfwLibrary.X11.cursor) { XFreeCursor(_glfwLibrary.X11.display, _glfwLibrary.X11.cursor);