From 83f57ff0ce7f06d22e5e2f8b585517a67083fa72 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 21 Aug 2013 10:14:16 +0200 Subject: [PATCH] Fixed potential segfault on init. --- README.md | 2 ++ src/init.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a8dabe9d..c4edca42 100644 --- a/README.md +++ b/README.md @@ -208,6 +208,8 @@ See the [GLFW documentation](http://www.glfw.org/docs/latest/). - Allowed character callback to be triggered regardless of modifier keys - Bugfix: The `-Wall` flag was not used with Clang and other GCC compatibles - Bugfix: The default for `GLFW_ALPHA_BITS` was set to zero + - Bugfix: `glfwInit` would segfault if monitor enumeration failed and no error + callback was set - [Win32] Added `_GLFW_USE_DWM_SWAP_INTERVAL` for forcing the swap interval to be set even when DWM compositing is enabled - [Win32] Added support for forcing the use of the high-performance GPU diff --git a/src/init.c b/src/init.c index 4e334d0e..d34abea7 100644 --- a/src/init.c +++ b/src/init.c @@ -130,7 +130,7 @@ GLFWAPI int glfwInit(void) _glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount); if (_glfw.monitors == NULL) { - _glfwErrorCallback(GLFW_PLATFORM_ERROR, "No monitors found"); + _glfwInputError(GLFW_PLATFORM_ERROR, "No monitors found"); _glfwPlatformTerminate(); return GL_FALSE; }