From ba761ab06e794005d93d49b1ec47b5cefa1479cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 20 Feb 2019 22:35:34 +0100 Subject: [PATCH] NSGL: Fix display link leaking and left running Related to #1417. --- src/nsgl_context.m | 8 ++++++++ 1 file changed, 8 insertions(+) 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;