diff --git a/lib/src/main/java/com/github/stephengold/vsport/BaseApplication.java b/lib/src/main/java/com/github/stephengold/vsport/BaseApplication.java index b550ed9d..83c96d9d 100644 --- a/lib/src/main/java/com/github/stephengold/vsport/BaseApplication.java +++ b/lib/src/main/java/com/github/stephengold/vsport/BaseApplication.java @@ -411,20 +411,19 @@ protected void render() { /** * Destroy the window and cleanly terminate GLFW. */ - private void cleanUpGlfw() { + private static void cleanUpGlfw() { if (windowHandle != MemoryUtil.NULL) { Callbacks.glfwFreeCallbacks(windowHandle); GLFW.glfwDestroyWindow(windowHandle); windowHandle = MemoryUtil.NULL; } + GLFW.glfwTerminate(); // Cancel the error callback: GLFWErrorCallback errorCallback = GLFW.glfwSetErrorCallback(null); if (errorCallback != null) { errorCallback.free(); } - - GLFW.glfwTerminate(); } /**