Procházet zdrojové kódy

Fix crash on exit or resume on iOS 13

Fixes #7966.

(cherry picked from commit 29bde8cd74bf6640058143aeafb0281c1b3a027f)
Max před 5 roky
rodič
revize
18484dd45e
1 změnil soubory, kde provedl 7 přidání a 8 odebrání
  1. 7 8
      platform/iphone/gl_view.mm

+ 7 - 8
platform/iphone/gl_view.mm

@@ -304,7 +304,6 @@ static void clear_touches() {
 	[self destroyFramebuffer];
 	[self createFramebuffer];
 	[self drawView];
-	[self drawView];
 }
 
 - (BOOL)createFramebuffer {
@@ -424,23 +423,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];