Make releaseCGLContext a no-op

It is sometimes called after the context is destroyed. Attempting to call any
gl* functions in this case causes a segfault.
bzip2
Graham 5 years ago
parent 9b7086f3a5
commit 5e18198ae4
  1. 14
      gl-natives/src/main/c/jaggl.c

@ -327,11 +327,15 @@ static void *jaggl_proc_addr(const char *name) {
} }
- (void)releaseCGLContext:(CGLContextObj)context { - (void)releaseCGLContext:(CGLContextObj)context {
CGLSetCurrentContext(context); /*
[lock lock]; * Ideally we'd delete the framebuffer/renderbuffers here, if they exist.
[self deleteFramebuffer]; * However, releaseCGLContext sometimes ends up being called after we
[lock unlock]; * destroy the jaggl_onscreen_context, so attempting to call any gl*
CGLClearDrawable(context); * functions here causes a segfault.
*
* Hopefully deleting the context will free up the
* framebuffer/renderbuffers implicitly.
*/
} }
@end @end
#endif #endif

Loading…
Cancel
Save