mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
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:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user