mirror of
https://github.com/glfw/glfw.git
synced 2024-11-15 02:34:36 +00:00
Make user context non current when destroyed
This commit is contained in:
parent
87ddca831a
commit
1cb8ab8dc6
@ -775,14 +775,14 @@ GLFWAPI GLFWusercontext* glfwCreateUserContext(GLFWwindow* handle)
|
||||
GLFWAPI void glfwDestroyUserContext(GLFWusercontext* handle)
|
||||
{
|
||||
_GLFWusercontext* context = (_GLFWusercontext*)handle;
|
||||
_GLFWusercontext* prev = _glfwPlatformGetTls(&_glfw.usercontextSlot);
|
||||
_GLFWusercontext* current = _glfwPlatformGetTls(&_glfw.usercontextSlot);
|
||||
|
||||
_GLFW_REQUIRE_INIT();
|
||||
|
||||
if (context)
|
||||
{
|
||||
if(prev==context)
|
||||
_glfwPlatformSetTls(&_glfw.usercontextSlot,NULL);
|
||||
if(current==context)
|
||||
glfwMakeContextCurrent(NULL);
|
||||
|
||||
context->destroy(context);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user