Commit 136ff5db authored by 余玠's avatar 余玠

fix GPU后台渲染的crash。

这种fix方法应该不是根本性的方案,但的确减少了线上相关crash日志
parent ac3bc276
...@@ -76,7 +76,9 @@ ...@@ -76,7 +76,9 @@
- (void)resume - (void)resume
{ {
[[_engine lifecycleChannel] sendMessage:@"AppLifecycleState.resumed"]; if([UIApplication sharedApplication].applicationState == UIApplicationStateActive){
[[_engine lifecycleChannel] sendMessage:@"AppLifecycleState.resumed"];
}
} }
- (void)inactive - (void)inactive
......
...@@ -272,8 +272,13 @@ static NSUInteger kInstanceCounter = 0; ...@@ -272,8 +272,13 @@ static NSUInteger kInstanceCounter = 0;
pageName:_name pageName:_name
params:_params params:_params
uniqueId:self.uniqueIDString]; uniqueId:self.uniqueIDString];
//NOTES:务必在show之后再update,否则有闪烁; 或导致侧滑返回时上一个页面会和top页面内容一样 //根据淘宝特价版日志证明,即使在UIViewController的viewDidAppear下,application也可能在inactive模式,此时如果提交渲染会导致GPU后台渲染而crash
[self surfaceUpdated:YES]; //参考:https://github.com/flutter/flutter/issues/57973
//https://github.com/flutter/engine/pull/18742
if([UIApplication sharedApplication].applicationState == UIApplicationStateActive){
//NOTES:务必在show之后再update,否则有闪烁; 或导致侧滑返回时上一个页面会和top页面内容一样
[self surfaceUpdated:YES];
}
[super viewDidAppear:animated]; [super viewDidAppear:animated];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment