mirror of
https://github.com/glfw/glfw.git
synced 2024-11-15 10:44:34 +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)
|
GLFWAPI void glfwDestroyUserContext(GLFWusercontext* handle)
|
||||||
{
|
{
|
||||||
_GLFWusercontext* context = (_GLFWusercontext*)handle;
|
_GLFWusercontext* context = (_GLFWusercontext*)handle;
|
||||||
_GLFWusercontext* prev = _glfwPlatformGetTls(&_glfw.usercontextSlot);
|
_GLFWusercontext* current = _glfwPlatformGetTls(&_glfw.usercontextSlot);
|
||||||
|
|
||||||
_GLFW_REQUIRE_INIT();
|
_GLFW_REQUIRE_INIT();
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
{
|
{
|
||||||
if(prev==context)
|
if(current==context)
|
||||||
_glfwPlatformSetTls(&_glfw.usercontextSlot,NULL);
|
glfwMakeContextCurrent(NULL);
|
||||||
|
|
||||||
context->destroy(context);
|
context->destroy(context);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user