diff --git a/src/win32_init.c b/src/win32_init.c index c26b93db..57acdb3a 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -387,6 +387,9 @@ int _glfwPlatformInit(void) void _glfwPlatformTerminate(void) { + if (_glfw.win32.helperWindow) + DestroyWindow(_glfw.win32.helperWindow); + _glfwUnregisterWindowClassWin32(); // Restore previous foreground lock timeout system setting @@ -405,9 +408,6 @@ void _glfwPlatformTerminate(void) _glfwTerminateJoysticksWin32(); _glfwTerminateThreadLocalStorageWin32(); - if (_glfw.win32.helperWindow) - DestroyWindow(_glfw.win32.helperWindow); - freeLibraries(); }