mirror of
https://github.com/glfw/glfw
synced 2026-09-26 16:18:21 +03: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 commit is contained in:
parent
8c5471d6cd
commit
fa0ea5c41f
1 changed files with 2 additions and 0 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue