Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 02fc8a4

Browse files
authored
Reland "iOS: Migrate FlutterEngine to ARC" (#55937)
This reverts commit 2484ae1. This relands commit 449df25. Migrates `FlutterEngine` from manual reference counting to ARC. Migrates properties from `retain` to strong and `assign` to `weak` (where referencing an Obj-C object). Includes two additional fixes on top of the original: * In `waitForFirstFrame:callback:` we ensure FlutterEngine isn't released on a background thread, but instead is always freed on the platform thread. * In `testViewControllerIsReleased` we call loadView prior to calling `viewDidLoad`. `viewDidLoad` calls `[FlutterEngine attachView]` which calls `[PlatformViewIOS::attachView]` which asserts that the view is loaded. No semantic changes, therefore no changes to tests. Issue: flutter/flutter#137801 Issue: flutter/flutter#156177 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent bf0b4f8 commit 02fc8a4

File tree

6 files changed

+293
-379
lines changed

6 files changed

+293
-379
lines changed

shell/platform/darwin/ios/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ source_set("flutter_framework_source_arc") {
7070
"framework/Source/FlutterDartVMServicePublisher.mm",
7171
"framework/Source/FlutterEmbedderKeyResponder.h",
7272
"framework/Source/FlutterEmbedderKeyResponder.mm",
73+
"framework/Source/FlutterEngine.mm",
7374
"framework/Source/FlutterEngineGroup.mm",
75+
"framework/Source/FlutterEngine_Internal.h",
7476
"framework/Source/FlutterHeadlessDartRunner.mm",
7577
"framework/Source/FlutterKeyPrimaryResponder.h",
7678
"framework/Source/FlutterKeySecondaryResponder.h",
@@ -186,8 +188,6 @@ source_set("flutter_framework_source") {
186188
# iOS embedder is migrating to ARC.
187189
# New files are highly encouraged to be in ARC.
188190
# To add new files in ARC, add them to the `flutter_framework_source_arc` target.
189-
"framework/Source/FlutterEngine.mm",
190-
"framework/Source/FlutterEngine_Internal.h",
191191
"framework/Source/FlutterViewController.mm",
192192
"framework/Source/FlutterViewController_Internal.h",
193193
"platform_view_ios.h",

0 commit comments

Comments
 (0)