Add internal TLS support

Related to #970.
This commit is contained in:
Camilla Löwy
2017-03-08 13:58:09 +01:00
parent 62414bff6e
commit aaf2800c9c
19 changed files with 109 additions and 116 deletions
+5
View File
@@ -113,6 +113,8 @@ static void terminate(void)
_glfwTerminateVulkan();
_glfwPlatformTerminate();
_glfwPlatformDestroyTls(&_glfw.context);
memset(&_glfw, 0, sizeof(_glfw));
}
@@ -162,6 +164,9 @@ GLFWAPI int glfwInit(void)
memset(&_glfw, 0, sizeof(_glfw));
_glfw.hints.init = _glfwInitHints;
if (!_glfwPlatformCreateTls(&_glfw.context))
return GLFW_FALSE;
if (!_glfwPlatformInit())
{
terminate();