Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prevent creation of multiple isolates when IrisMethodChannel.initialize is called multiple times simultaneously #98

Merged
merged 3 commits into from
Apr 19, 2024

Conversation

littleGnAl
Copy link
Contributor

@littleGnAl littleGnAl commented Apr 18, 2024

A case like:

for (int i = 0; i < 5; ++i) {
  irisMethodChannel.initilize([]);
}

If we do not guard the initialization only once, multiple isolates will be created.

…tialize is called multiple times simultaneously
…tialize is called multiple times simultaneously
…tialize is called multiple times simultaneously
@littleGnAl littleGnAl force-pushed the littlegnal/isolate-spawn-once branch from f9e5bf3 to d5c7003 Compare April 18, 2024 10:18
@littleGnAl littleGnAl merged commit 20779db into main Apr 19, 2024
49 checks passed
@littleGnAl littleGnAl deleted the littlegnal/isolate-spawn-once branch April 19, 2024 10:03
littleGnAl added a commit to AgoraIO-Extensions/Agora-Flutter-SDK that referenced this pull request Apr 21, 2024
…Engine.initialize` is called simultaneously (#1712)

A case like:
```dart
for (int i = 0; i < 5; ++i) {
  rtcEngine.initialize(RtcEngineContext(
    appId: engineAppId,
    areaCode: AreaCode.areaCodeGlob.value(),
    logConfig: LogConfig(filePath: logPath),
  ));
}
```
This causes `irisMethodChannel.initilize(args)`, and
`_initializeInternal(context)` called multiple times, which causes
unexpected behaviors.

`iris_method_channel` fix:
AgoraIO-Extensions/iris_method_channel_flutter#98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant