diff options
author | Max <ealataur@gmail.com> | 2019-10-29 10:58:59 +0300 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-11-05 10:28:42 +0100 |
commit | 29bde8cd74bf6640058143aeafb0281c1b3a027f (patch) | |
tree | ee79b395beb15b44a948391139c23da76341d76e /platform | |
parent | dc114fa2ef336646f56d71322ba0236c00f8228e (diff) |
Fix crash on exit or resume on iOS 13
Fixes #7966.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/iphone/gl_view.mm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index 2ac158e6d3..4e6b8e1ada 100644 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -340,6 +340,7 @@ static void clear_touches() { [EAGLContext setCurrentContext:context]; [self destroyFramebuffer]; [self createFramebuffer]; + [self drawView]; } - (BOOL)createFramebuffer { @@ -455,23 +456,23 @@ static void clear_touches() { // Updates the OpenGL view when the timer fires - (void)drawView { + + if (!active) { + printf("draw view not active!\n"); + return; + }; if (useCADisplayLink) { // Pause the CADisplayLink to avoid recursion [displayLink setPaused:YES]; // Process all input events - while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, TRUE) == kCFRunLoopRunHandledSource) + while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0, TRUE) == kCFRunLoopRunHandledSource) ; // We are good to go, resume the CADisplayLink [displayLink setPaused:NO]; } - if (!active) { - printf("draw view not active!\n"); - return; - }; - // Make sure that you are drawing to the current context [EAGLContext setCurrentContext:context]; |