@ -969,7 +969,9 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
[window->NSGL.pixelFormat release];
window->NSGL.pixelFormat = nil;
[NSOpenGLContext clearCurrentContext];
if ([NSOpenGLContext currentContext] == window->NSGL.context)
[window->NSGL.context release];
window->NSGL.context = nil;