Skip to content

Commit

Permalink
Merge pull request #33154 from ealataur/master
Browse files Browse the repository at this point in the history
fix crash on iOS 13
  • Loading branch information
akien-mga authored Nov 5, 2019
2 parents dc114fa + 29bde8c commit 2cf7f53
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions platform/iphone/gl_view.mm
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ - (void)layoutSubviews {
[EAGLContext setCurrentContext:context];
[self destroyFramebuffer];
[self createFramebuffer];
[self drawView];
}

- (BOOL)createFramebuffer {
Expand Down Expand Up @@ -455,23 +456,23 @@ - (void)setAnimationInterval:(NSTimeInterval)interval {

// 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];

Expand Down

0 comments on commit 2cf7f53

Please sign in to comment.