Merge pull request #33154 from ealataur/master

fix crash on iOS 13
This commit is contained in:
Rémi Verschelde 2019-11-05 12:10:32 +01:00 committed by GitHub
commit 2cf7f533ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 11 deletions

View File

@ -340,6 +340,7 @@ static void clear_touches() {
[EAGLContext setCurrentContext:context];
[self destroyFramebuffer];
[self createFramebuffer];
[self drawView];
}
- (BOOL)createFramebuffer {
@ -455,22 +456,22 @@ static void clear_touches() {
// Updates the OpenGL view when the timer fires
- (void)drawView {
if (useCADisplayLink) {
// Pause the CADisplayLink to avoid recursion
[displayLink setPaused:YES];
// Process all input events
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, TRUE) == kCFRunLoopRunHandledSource)
;
// We are good to go, resume the CADisplayLink
[displayLink setPaused:NO];
}
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.0, TRUE) == kCFRunLoopRunHandledSource)
;
// We are good to go, resume the CADisplayLink
[displayLink setPaused:NO];
}
// Make sure that you are drawing to the current context
[EAGLContext setCurrentContext:context];