NSGL: Fix display link leaking and left running

Related to #1417.
This commit is contained in:
Camilla Löwy 2019-02-20 22:35:34 +01:00
parent d0e8d06d95
commit ba761ab06e

View File

@ -125,6 +125,14 @@ static void destroyContextNSGL(_GLFWwindow* window)
{ {
@autoreleasepool { @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 release];
window->context.nsgl.pixelFormat = nil; window->context.nsgl.pixelFormat = nil;