Disable FlutterMetalLayer by default. (flutter/engine#54095)

Backing textures aren't getting deallocated, which is causing memory leaks and crashing devicelab.
This commit is contained in:
Jonah Williams 2024-07-24 19:34:16 -07:00 committed by GitHub
parent dc9ff41cb8
commit f4ca71ce57

View File

@ -424,14 +424,14 @@ extern CFTimeInterval display_link_target;
}
+ (BOOL)enabled {
static BOOL enabled = YES;
static BOOL enabled = NO;
static BOOL didCheckInfoPlist = NO;
if (!didCheckInfoPlist) {
didCheckInfoPlist = YES;
NSNumber* use_flutter_metal_layer =
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTUseFlutterMetalLayer"];
if (use_flutter_metal_layer != nil && ![use_flutter_metal_layer boolValue]) {
enabled = NO;
if (use_flutter_metal_layer != nil && [use_flutter_metal_layer boolValue]) {
enabled = YES;
}
}
return enabled;