|
|
@ -233,6 +233,14 @@ static void *jaggl_proc_addr(const char *name) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
- (void)dealloc { |
|
|
|
- (void)dealloc { |
|
|
|
|
|
|
|
if (framebuffer && CGLSetCurrentContext(jaggl_onscreen_context) == kCGLNoError) { |
|
|
|
|
|
|
|
glDeleteRenderbuffersEXT(1, &renderbuffer_depth); |
|
|
|
|
|
|
|
glDeleteRenderbuffersEXT(1, &renderbuffer_color); |
|
|
|
|
|
|
|
glDeleteFramebuffersEXT(1, &framebuffer); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CGLSetCurrentContext(NULL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[lock release]; |
|
|
|
[lock release]; |
|
|
|
[super dealloc]; |
|
|
|
[super dealloc]; |
|
|
|
} |
|
|
|
} |
|
|
@ -362,15 +370,7 @@ static void *jaggl_proc_addr(const char *name) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
- (void)releaseCGLContext:(CGLContextObj)context { |
|
|
|
- (void)releaseCGLContext:(CGLContextObj)context { |
|
|
|
/*
|
|
|
|
// empty
|
|
|
|
* Ideally we'd delete the framebuffer/renderbuffers here, if they exist. |
|
|
|
|
|
|
|
* However, releaseCGLContext sometimes ends up being called after we |
|
|
|
|
|
|
|
* destroy the jaggl_onscreen_context, so attempting to call any gl* |
|
|
|
|
|
|
|
* functions here causes a segfault. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Hopefully deleting the context will free up the |
|
|
|
|
|
|
|
* framebuffer/renderbuffers implicitly. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@end |
|
|
|
@end |
|
|
|
#endif |
|
|
|
#endif |
|
|
|