Skip to content

Commit

Permalink
BaseApplication: rearrange cleanupGlfw() and make it "static"
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Aug 21, 2023
1 parent cf626e4 commit b10f857
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down

0 comments on commit b10f857

Please sign in to comment.