Fix FlutterMetalLayer testDealloc flakiness on iOS 18 (flutter/engine#54403)
Fixes https://github.com/flutter/flutter/issues/152990 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
@@ -283,8 +283,11 @@
|
||||
[compositor commitTransaction];
|
||||
|
||||
[self removeMetalLayer:layer];
|
||||
}
|
||||
CFTimeInterval start = CACurrentMediaTime();
|
||||
while (weakLayer != nil && CACurrentMediaTime() - start < 1) {
|
||||
// Deallocating the layer after removing is not synchronous.
|
||||
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, YES);
|
||||
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.01, YES);
|
||||
}
|
||||
|
||||
XCTAssertNil(weakLayer);
|
||||
|
||||
Reference in New Issue
Block a user