diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index faa6431a..ee473382 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -202,6 +202,7 @@ video tutorials. - Matt Sealey - Steve Sexton - Arkady Shapkin + - Mingjie Shen - Ali Sherief - Yoshiki Shibukawa - Dmitri Shuralyov diff --git a/README.md b/README.md index 19e361c6..080ab1e2 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ information on what to include when reporting a bug. ## Changelog - Bugfix: `glfwGetKeyScancode` returned `0` on error when initialized instead of `-1` + - Bugfix: Failure to make a newly created context current could cause segfault (#2327) - [Win32] Fix pkg-config for dynamic library on Windows (#2386, #2420) - [Win32] Bugfix: `glfwWaitEventsTimeout` did not return for some sent messages (#2408) - [Wayland] Added improved fallback window decorations via libdecor (#1639,#1693) diff --git a/src/context.c b/src/context.c index 93c9a935..b81934bb 100644 --- a/src/context.c +++ b/src/context.c @@ -363,6 +363,8 @@ GLFWbool _glfwRefreshContextAttribs(_GLFWwindow* window, previous = _glfwPlatformGetTls(&_glfw.contextSlot); glfwMakeContextCurrent((GLFWwindow*) window); + if (_glfwPlatformGetTls(&_glfw.contextSlot) != window) + return GLFW_FALSE; window->context.GetIntegerv = (PFNGLGETINTEGERVPROC) window->context.getProcAddress("glGetIntegerv");