diff --git a/src/nsgl_context.m b/src/nsgl_context.m index 69eab1c1..ae1d18b8 100755 --- a/src/nsgl_context.m +++ b/src/nsgl_context.m @@ -125,6 +125,14 @@ static void destroyContextNSGL(_GLFWwindow* window) { @autoreleasepool { + if (window->context.nsgl.displayLink) + { + if (CVDisplayLinkIsRunning(window->context.nsgl.displayLink)) + CVDisplayLinkStop(window->context.nsgl.displayLink); + + CVDisplayLinkRelease(window->context.nsgl.displayLink); + } + [window->context.nsgl.pixelFormat release]; window->context.nsgl.pixelFormat = nil;