File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -389,7 +389,8 @@ class Store {
389389 queriesCaseSensitiveDefault: isoPass.queriesCaseSensitiveDefault);
390390 final result = await isoPass.runFn (store);
391391 store.close ();
392- // Note: maybe replace with Isolate.exit once min Dart SDK 2.15.
392+ // Note: maybe replace with Isolate.exit (and remove kill call in
393+ // runIsolated) once min Dart SDK 2.15.
393394 isoPass.resultPort? .send (result);
394395 }
395396
@@ -402,7 +403,7 @@ class Store {
402403 TxMode mode, FutureOr <R > Function (Store , P ) callback, P param) async {
403404 final resultPort = ReceivePort ();
404405 // Await isolate spawn to avoid waiting forever if it fails to spawn.
405- await Isolate .spawn (
406+ final isolate = await Isolate .spawn (
406407 _callFunctionWithStoreInIsolate,
407408 _IsoPass (_defs, directoryPath, _queriesCaseSensitiveDefault,
408409 resultPort.sendPort, callback, param));
@@ -413,6 +414,7 @@ class Store {
413414 });
414415 await result.future;
415416 resultPort.close ();
417+ isolate.kill ();
416418 return result.future;
417419 }
418420
You can’t perform that action at this time.
0 commit comments