diff --git a/README.md b/README.md index d7e0555a..70aae477 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,9 @@ See the [GLFW 3.0 documentation](http://www.glfw.org/docs/3.0/). ## Changelog + - [Win32] Bugfix: Context creation was attempted even if no valid pixel formats + had been found + ## Contact diff --git a/src/wgl_context.c b/src/wgl_context.c index d98ba063..61d9a22e 100644 --- a/src/wgl_context.c +++ b/src/wgl_context.c @@ -276,9 +276,13 @@ static GLboolean choosePixelFormat(_GLFWwindow* window, } closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount); - if (closest) - *result = closest->wgl; + if (!closest) + { + free(usableConfigs); + return GL_FALSE; + } + *result = closest->wgl; free(usableConfigs); return GL_TRUE;