Skip to content

Commit

Permalink
[Cleanup] fix ios warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chipweinberger committed Jan 24, 2024
1 parent dc7f426 commit 768ac66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
23 changes: 7 additions & 16 deletions ios/Classes/FlutterIsolatePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,17 @@ - (void)startNextIsolate {

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

isolate.engine = [self.engineGroup makeEngineWithEntrypoint:info.callbackName libraryURI:info.callbackLibraryPath];

if ([isolate.engine respondsToSelector:@selector(initWithName:project:allowHeadlessExecution:)]) {
// use headless execution, if we can
((id(*)(id,SEL,id,id,id))objc_msgSend)(isolate.engine, @selector(initWithName:project:allowHeadlessExecution:) , isolate.isolateId, nil, @(YES));
} else {
// older versions before above is available
[isolate.engine initWithName:isolate.isolateId project:nil];
}
isolate.engine = [[self.engineGroup makeEngineWithEntrypoint:info.callbackName libraryURI:info.callbackLibraryPath]
initWithName:isolate.isolateId project:nil allowHeadlessExecution:YES];

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

isolate.controlChannel = [FlutterMethodChannel methodChannelWithName:FLUTTER_ISOLATE_NAMESPACE @"/control"
binaryMessenger:isolate.engine];
isolate.controlChannel = [FlutterMethodChannel methodChannelWithName:FLUTTER_ISOLATE_NAMESPACE @"/control" binaryMessenger:isolate.engine.binaryMessenger];

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

[isolate.startupChannel setStreamHandler:self];
[_registrar addMethodCallDelegate:self channel:isolate.controlChannel];
Expand Down
2 changes: 1 addition & 1 deletion macos/Classes/FlutterIsolatePluginMacOS.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ - (void)startNextIsolate
* then this will be a race on the FlutterEventChannels initialization, and could deadlock. */
[isolate.engine runWithEntrypoint:@"_flutterIsolateEntryPoint"];


isolate.controlChannel = [FlutterMethodChannel methodChannelWithName:FLUTTER_ISOLATE_NAMESPACE @"/control"
binaryMessenger:isolate.engine.binaryMessenger];

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

[isolate.startupChannel setStreamHandler:self];

[_registrar addMethodCallDelegate:self channel:isolate.controlChannel];

[[FlutterIsolatePluginMacOS lookupGeneratedPluginRegistrant] registerWithRegistry:isolate.engine];
Expand Down

0 comments on commit 768ac66

Please sign in to comment.