Skip to content

Commit e4f3402

Browse files
[Cleanup] fix ios warnings
1 parent dc7f426 commit e4f3402

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

ios/Classes/FlutterIsolatePlugin.m

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,19 @@ - (void)startNextIsolate {
6868

6969
FlutterCallbackInformation *info = [FlutterCallbackCache lookupCallbackInformation:isolate.entryPoint];
7070

71-
isolate.engine = [self.engineGroup makeEngineWithEntrypoint:info.callbackName libraryURI:info.callbackLibraryPath];
72-
73-
if ([isolate.engine respondsToSelector:@selector(initWithName:project:allowHeadlessExecution:)]) {
74-
// use headless execution, if we can
75-
((id(*)(id,SEL,id,id,id))objc_msgSend)(isolate.engine, @selector(initWithName:project:allowHeadlessExecution:) , isolate.isolateId, nil, @(YES));
76-
} else {
77-
// older versions before above is available
78-
[isolate.engine initWithName:isolate.isolateId project:nil];
79-
}
71+
isolate.engine = [[self.engineGroup makeEngineWithEntrypoint:info.callbackName libraryURI:info.callbackLibraryPath]
72+
initWithName:isolate.isolateId project:nil allowHeadlessExecution:YES];
8073

81-
/* not entire sure if a listen on an event channel will be queued
82-
* as we cannot register the event channel until after runWithEntryPoint has been called. If it is not queued
83-
* then this will be a race on the FlutterEventChannels initialization, and could deadlock. */
74+
// not entire sure if a listen on an event channel will be queued
75+
// as we cannot register the event channel until after runWithEntryPoint has been called. If it is not queued
76+
// then this will be a race on the FlutterEventChannels initialization, and could deadlock.
8477
[isolate.engine runWithEntrypoint:info.callbackName libraryURI:info.callbackLibraryPath];
8578

8679
isolate.controlChannel = [FlutterMethodChannel methodChannelWithName:FLUTTER_ISOLATE_NAMESPACE @"/control"
87-
binaryMessenger:isolate.engine];
80+
binaryMessenger:isolate.engine.binaryMessenger];
8881

8982
isolate.startupChannel = [FlutterEventChannel eventChannelWithName:FLUTTER_ISOLATE_NAMESPACE @"/event"
90-
binaryMessenger:isolate.engine];
83+
binaryMessenger:isolate.engine.binaryMessenger];
9184

9285
[isolate.startupChannel setStreamHandler:self];
9386
[_registrar addMethodCallDelegate:self channel:isolate.controlChannel];

macos/Classes/FlutterIsolatePluginMacOS.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ - (void)startNextIsolate
7979
* then this will be a race on the FlutterEventChannels initialization, and could deadlock. */
8080
[isolate.engine runWithEntrypoint:@"_flutterIsolateEntryPoint"];
8181

82-
8382
isolate.controlChannel = [FlutterMethodChannel methodChannelWithName:FLUTTER_ISOLATE_NAMESPACE @"/control"
8483
binaryMessenger:isolate.engine.binaryMessenger];
8584

8685
isolate.startupChannel = [FlutterEventChannel eventChannelWithName:FLUTTER_ISOLATE_NAMESPACE @"/event"
8786
binaryMessenger:isolate.engine.binaryMessenger];
8887

8988
[isolate.startupChannel setStreamHandler:self];
89+
9090
[_registrar addMethodCallDelegate:self channel:isolate.controlChannel];
9191

9292
[[FlutterIsolatePluginMacOS lookupGeneratedPluginRegistrant] registerWithRegistry:isolate.engine];

0 commit comments

Comments
 (0)