@@ -68,26 +68,17 @@ - (void)startNextIsolate {
68
68
69
69
FlutterCallbackInformation *info = [FlutterCallbackCache lookupCallbackInformation: isolate.entryPoint];
70
70
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 ];
80
73
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.
84
77
[isolate.engine runWithEntrypoint: info.callbackName libraryURI: info.callbackLibraryPath];
85
78
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];
88
80
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];
91
82
92
83
[isolate.startupChannel setStreamHandler: self ];
93
84
[_registrar addMethodCallDelegate: self channel: isolate.controlChannel];
0 commit comments