From 911433bc293cfacc8de31c62ea2a0cde8d114f71 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Tue, 12 Sep 2023 11:43:40 -0700 Subject: [PATCH] [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 --- .../platform/darwin/ios/framework/Source/FlutterEngineTest.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm index 2971c23f90..9a64083b1d 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm @@ -113,7 +113,7 @@ FLUTTER_ASSERT_ARC - (void)testDeallocated { __weak FlutterEngine* weakEngine = nil; - { + @autoreleasepool { FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"foobar"]; weakEngine = engine; [engine run];