From 79e2433eb06f5b3528f146369bbc937cabd91374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 6 Nov 2017 17:42:15 +0100 Subject: [PATCH] Fix termination on sync object creation failure --- src/init.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/init.c b/src/init.c index 19a13e0d..336932e5 100644 --- a/src/init.c +++ b/src/init.c @@ -205,12 +205,13 @@ GLFWAPI int glfwInit(void) return GLFW_FALSE; } - if (!_glfwPlatformCreateMutex(&_glfw.errorLock)) - return GLFW_FALSE; - if (!_glfwPlatformCreateTls(&_glfw.errorSlot)) - return GLFW_FALSE; - if (!_glfwPlatformCreateTls(&_glfw.contextSlot)) + if (!_glfwPlatformCreateMutex(&_glfw.errorLock) || + !_glfwPlatformCreateTls(&_glfw.errorSlot) || + !_glfwPlatformCreateTls(&_glfw.contextSlot)) + { + terminate(); return GLFW_FALSE; + } _glfwPlatformSetTls(&_glfw.errorSlot, &_glfwMainThreadError);