Skip to content

Commit

Permalink
iOS: Migrate FlutterHeadlessDartRunner to ARC
Browse files Browse the repository at this point in the history
This is a subclass of FlutterEngine, which is still manually reference
counted, but that's not problematic since the headers have been migrated
to ARC-safe syntax that preserves existing behaviour.

Issue: flutter/flutter#137801
  • Loading branch information
cbracken committed Sep 27, 2024
1 parent e00d405 commit 76f38ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion shell/platform/darwin/ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ source_set("flutter_framework_source_arc") {
"framework/Source/FlutterDartVMServicePublisher.mm",
"framework/Source/FlutterEmbedderKeyResponder.h",
"framework/Source/FlutterEmbedderKeyResponder.mm",
"framework/Source/FlutterHeadlessDartRunner.mm",
"framework/Source/FlutterKeyPrimaryResponder.h",
"framework/Source/FlutterKeySecondaryResponder.h",
"framework/Source/FlutterKeyboardManager.h",
Expand Down Expand Up @@ -183,7 +184,6 @@ source_set("flutter_framework_source") {
"framework/Source/FlutterEngine.mm",
"framework/Source/FlutterEngineGroup.mm",
"framework/Source/FlutterEngine_Internal.h",
"framework/Source/FlutterHeadlessDartRunner.mm",
"framework/Source/FlutterPlatformPlugin.h",
"framework/Source/FlutterPlatformPlugin.mm",
"framework/Source/FlutterViewController.mm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
#import "flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h"
#import "flutter/shell/platform/darwin/ios/platform_view_ios.h"

@implementation FlutterHeadlessDartRunner {
}
FLUTTER_ASSERT_ARC

@implementation FlutterHeadlessDartRunner

- (instancetype)initWithName:(NSString*)labelPrefix project:(FlutterDartProject*)projectOrNil {
return [self initWithName:labelPrefix project:projectOrNil allowHeadlessExecution:YES];
Expand Down Expand Up @@ -56,4 +57,5 @@ - (instancetype)initWithName:(NSString*)labelPrefix
- (instancetype)init {
return [self initWithName:@"io.flutter.headless" project:nil];
}

@end

0 comments on commit 76f38ce

Please sign in to comment.