From ebb69adc360cdc01d79a4b7b30aa6ae6353f867d Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 9 Feb 2011 12:17:01 +0100 Subject: [PATCH] Silly, silly me. --- src/error.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/error.c b/src/error.c index 0725dd7a..1967dd85 100644 --- a/src/error.c +++ b/src/error.c @@ -47,6 +47,12 @@ static int _glfwError = GLFW_NO_ERROR; void _glfwSetError(int error, const char* description) { + if (!_glfwInitialized) + { + _glfwError = error; + return; + } + if (_glfwLibrary.errorCallback) { if (!description) @@ -117,10 +123,7 @@ GLFWAPI void glfwSetErrorCallback(GLFWerrorfun cbfun) { if (!_glfwInitialized) { - // We can't call _glfwSetError here as _glfwLibrary is uninitialized - // This should be the only place outside of _glfwSetError where we set - // the global error status directly - _glfwError = GLFW_NOT_INITIALIZED; + _glfwSetError(GLFW_NOT_INITIALIZED, NULL); return; }