mirror of
https://github.com/glfw/glfw.git
synced 2024-11-14 10:34:34 +00:00
Fix potential violation of invariant
The shared function for reading back context attributes, _glfwRefreshContextAttribs, did not check whether the newly created context had been successfully made current. This violated the invariant that the context TLS slot always points to a valid window and that its context is current whenever _glfw.platform.getProcAddress is called. Related to #2327 This was adapted to 3.3-stable fromfa0ea5c41f
andddd92a4fa8
.
This commit is contained in:
parent
11f517e557
commit
cb0dafa7c0
@ -202,6 +202,7 @@ video tutorials.
|
|||||||
- Matt Sealey
|
- Matt Sealey
|
||||||
- Steve Sexton
|
- Steve Sexton
|
||||||
- Arkady Shapkin
|
- Arkady Shapkin
|
||||||
|
- Mingjie Shen
|
||||||
- Ali Sherief
|
- Ali Sherief
|
||||||
- Yoshiki Shibukawa
|
- Yoshiki Shibukawa
|
||||||
- Dmitri Shuralyov
|
- Dmitri Shuralyov
|
||||||
|
@ -124,6 +124,7 @@ information on what to include when reporting a bug.
|
|||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
- Bugfix: `glfwGetKeyScancode` returned `0` on error when initialized instead of `-1`
|
- 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] Fix pkg-config for dynamic library on Windows (#2386, #2420)
|
||||||
- [Win32] Bugfix: `glfwWaitEventsTimeout` did not return for some sent messages (#2408)
|
- [Win32] Bugfix: `glfwWaitEventsTimeout` did not return for some sent messages (#2408)
|
||||||
- [Wayland] Added improved fallback window decorations via libdecor (#1639,#1693)
|
- [Wayland] Added improved fallback window decorations via libdecor (#1639,#1693)
|
||||||
|
@ -363,6 +363,8 @@ GLFWbool _glfwRefreshContextAttribs(_GLFWwindow* window,
|
|||||||
|
|
||||||
previous = _glfwPlatformGetTls(&_glfw.contextSlot);
|
previous = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||||
glfwMakeContextCurrent((GLFWwindow*) window);
|
glfwMakeContextCurrent((GLFWwindow*) window);
|
||||||
|
if (_glfwPlatformGetTls(&_glfw.contextSlot) != window)
|
||||||
|
return GLFW_FALSE;
|
||||||
|
|
||||||
window->context.GetIntegerv = (PFNGLGETINTEGERVPROC)
|
window->context.GetIntegerv = (PFNGLGETINTEGERVPROC)
|
||||||
window->context.getProcAddress("glGetIntegerv");
|
window->context.getProcAddress("glGetIntegerv");
|
||||||
|
Loading…
Reference in New Issue
Block a user