瀏覽代碼

Merge pull request #33154 from ealataur/master

fix crash on iOS 13
Rémi Verschelde 5 年之前
父節點
當前提交
2cf7f533ee
共有 1 個文件被更改,包括 7 次插入6 次删除
  1. 7 6
      platform/iphone/gl_view.mm

+ 7 - 6
platform/iphone/gl_view.mm

@@ -340,6 +340,7 @@ static void clear_touches() {
 	[EAGLContext setCurrentContext:context];
 	[EAGLContext setCurrentContext:context];
 	[self destroyFramebuffer];
 	[self destroyFramebuffer];
 	[self createFramebuffer];
 	[self createFramebuffer];
+	[self drawView];
 }
 }
 
 
 - (BOOL)createFramebuffer {
 - (BOOL)createFramebuffer {
@@ -455,23 +456,23 @@ static void clear_touches() {
 
 
 // Updates the OpenGL view when the timer fires
 // Updates the OpenGL view when the timer fires
 - (void)drawView {
 - (void)drawView {
+
+	if (!active) {
+		printf("draw view not active!\n");
+		return;
+	};
 	if (useCADisplayLink) {
 	if (useCADisplayLink) {
 		// Pause the CADisplayLink to avoid recursion
 		// Pause the CADisplayLink to avoid recursion
 		[displayLink setPaused:YES];
 		[displayLink setPaused:YES];
 
 
 		// Process all input events
 		// 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
 		// We are good to go, resume the CADisplayLink
 		[displayLink setPaused:NO];
 		[displayLink setPaused:NO];
 	}
 	}
 
 
-	if (!active) {
-		printf("draw view not active!\n");
-		return;
-	};
-
 	// Make sure that you are drawing to the current context
 	// Make sure that you are drawing to the current context
 	[EAGLContext setCurrentContext:context];
 	[EAGLContext setCurrentContext:context];