[ios] Fix testDeallocated failing locally. (flutter/engine#45663)

Moving the code block to autorelease pool to ensure the FlutterEngine is released in the test.

Fixes: https://github.com/flutter/flutter/issues/134388

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
Chris Yang
2023-09-12 11:43:40 -07:00
committed by GitHub
parent 4e1274df93
commit 911433bc29

View File

@@ -113,7 +113,7 @@ FLUTTER_ASSERT_ARC
- (void)testDeallocated {
__weak FlutterEngine* weakEngine = nil;
{
@autoreleasepool {
FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"foobar"];
weakEngine = engine;
[engine run];