From 849977c7b2df2a4cb423fc47789abc49169f72f3 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 8 Mar 2011 23:14:42 +0100 Subject: [PATCH] Allow closing of NULL. --- src/window.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/window.c b/src/window.c index f0f504c5..5ce8cfa0 100644 --- a/src/window.c +++ b/src/window.c @@ -523,6 +523,10 @@ GLFWAPI void glfwCloseWindow(GLFWwindow handle) _GLFWwindow* window = (_GLFWwindow*) handle; + // Allow closing of NULL (to match the behavior of free) + if (window == NULL) + return; + // Show mouse pointer again (if hidden) if (window == _glfwLibrary.cursorLockWindow) glfwEnable(window, GLFW_MOUSE_CURSOR);