ui/app: (macOS) destroy the GL context correctly

The NSOpenGLView owns the NSOpenGLContext so we can't just CFRelease
the context. Use [NSOpenGLView releaseGLContext] instead.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-20 15:47:02 +02:00
parent 0b6e6c58dd
commit 05f0c3e22a
3 changed files with 15 additions and 6 deletions
+5
View File
@@ -143,6 +143,11 @@ CFTypeRef gio_contextForView(CFTypeRef viewRef) {
return (__bridge CFTypeRef)view.openGLContext;
}
void gio_clearGLContext(CFTypeRef viewRef) {
NSOpenGLView *view = (__bridge NSOpenGLView *)viewRef;
[view clearGLContext];
}
void gio_clearCurrentContext(void) {
[NSOpenGLContext clearCurrentContext];
}