Skip to content

Commit 797d403

Browse files
[Cleaup] fix warnings on iOS
1 parent dc7f426 commit 797d403

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

ios/Classes/FlutterIsolatePlugin.m

+7-16
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,17 @@ - (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

86-
isolate.controlChannel = [FlutterMethodChannel methodChannelWithName:FLUTTER_ISOLATE_NAMESPACE @"/control"
87-
binaryMessenger:isolate.engine];
79+
isolate.controlChannel = [FlutterMethodChannel methodChannelWithName:FLUTTER_ISOLATE_NAMESPACE @"/control" binaryMessenger:isolate.engine.binaryMessenger];
8880

89-
isolate.startupChannel = [FlutterEventChannel eventChannelWithName:FLUTTER_ISOLATE_NAMESPACE @"/event"
90-
binaryMessenger:isolate.engine];
81+
isolate.startupChannel = [FlutterEventChannel eventChannelWithName:FLUTTER_ISOLATE_NAMESPACE @"/event" binaryMessenger:isolate.engine.binaryMessenger];
9182

9283
[isolate.startupChannel setStreamHandler:self];
9384
[_registrar addMethodCallDelegate:self channel:isolate.controlChannel];

macos/Classes/FlutterIsolatePluginMacOS.m

+1-1
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)