From a1a1b77150bc9417aa632692ecab106cad885543 Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Wed, 15 Jul 2020 11:19:18 +0100 Subject: [PATCH] Added _GLFW_REQUIRE* to user context functions. --- src/context.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/context.c b/src/context.c index fa1a4d78..5bab2d01 100644 --- a/src/context.c +++ b/src/context.c @@ -763,6 +763,8 @@ GLFWAPI GLFWusercontext* glfwCreateUserContext(GLFWwindow* handle) _GLFWusercontext* context; _GLFWwindow* window = (_GLFWwindow*)handle; + _GLFW_REQUIRE_INIT_OR_RETURN(NULL); + context = _glfwPlatformCreateUserContext(window); return (GLFWusercontext*)context; @@ -771,6 +773,9 @@ GLFWAPI GLFWusercontext* glfwCreateUserContext(GLFWwindow* handle) GLFWAPI void glfwDestroyUserContext(GLFWusercontext* handle) { _GLFWusercontext* context = (_GLFWusercontext*)handle; + + _GLFW_REQUIRE_INIT(); + if (context) context->destroy(context); } @@ -779,6 +784,8 @@ GLFWAPI void glfwMakeUserContextCurrent(GLFWusercontext* handle) { _GLFWusercontext* context = (_GLFWusercontext*)handle; + _GLFW_REQUIRE_INIT(); + glfwMakeContextCurrent(NULL); if (context)