diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d5d38a..030ec6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.5.7 + +- Refactored `Isolate.spawn` logic to make sure we are closing after execution + ## 3.5.6 - Added support to linux ARM64 devices diff --git a/example/pubspec.lock b/example/pubspec.lock index 2db8a88..d6693ac 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -119,7 +119,7 @@ packages: path: ".." relative: true source: path - version: "3.5.6" + version: "3.5.7" ffi: dependency: transitive description: diff --git a/lib/bridge/binding.dart b/lib/bridge/binding.dart index 6c8176c..b5068ac 100644 --- a/lib/bridge/binding.dart +++ b/lib/bridge/binding.dart @@ -36,19 +36,14 @@ class Binding { final port = ReceivePort(); final args = IsolateArguments(name, payload, port.sendPort); - Isolate.spawn( - callBridge, - args, - onError: port.sendPort, - onExit: port.sendPort, - ); + final isolate = await Isolate.spawn(callBridge, args); Completer completer = new Completer(); - StreamSubscription? subscription; - subscription = port.listen((message) async { - await subscription?.cancel(); + port.listen((message) async { completer.complete(message); + port.close(); + isolate.kill(); }); return completer.future; } diff --git a/pubspec.yaml b/pubspec.yaml index 8e17f8a..1362eb8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fast_rsa description: library for use RSA with support for android and ios, macOS, linux, windows and web -version: 3.5.6 +version: 3.5.7 homepage: https://github.com/jerson/flutter-rsa environment: