diff --git a/src/egl_context.c b/src/egl_context.c index 64dcdd6f..4f76d351 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -311,6 +311,7 @@ static int extensionSupportedEGL(const char* extension) static GLFWglproc getProcAddressEGL(const char* procname) { _GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot); + assert(window != NULL); if (window->context.egl.client) { diff --git a/src/glx_context.c b/src/glx_context.c index 4406dfd3..f3f4b3ec 100644 --- a/src/glx_context.c +++ b/src/glx_context.c @@ -192,6 +192,7 @@ static void swapBuffersGLX(_GLFWwindow* window) static void swapIntervalGLX(int interval) { _GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot); + assert(window != NULL); if (_glfw.glx.EXT_swap_control) { diff --git a/src/nsgl_context.m b/src/nsgl_context.m index 878f32ed..de89e421 100644 --- a/src/nsgl_context.m +++ b/src/nsgl_context.m @@ -83,11 +83,10 @@ static void swapIntervalNSGL(int interval) @autoreleasepool { _GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot); - if (window) - { - [window->context.nsgl.object setValues:&interval - forParameter:NSOpenGLContextParameterSwapInterval]; - } + assert(window != NULL); + + [window->context.nsgl.object setValues:&interval + forParameter:NSOpenGLContextParameterSwapInterval]; } // autoreleasepool } diff --git a/src/wgl_context.c b/src/wgl_context.c index cfe24b27..08c499ff 100644 --- a/src/wgl_context.c +++ b/src/wgl_context.c @@ -332,6 +332,7 @@ static void swapBuffersWGL(_GLFWwindow* window) static void swapIntervalWGL(int interval) { _GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot); + assert(window != NULL); window->context.wgl.interval = interval;