File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 14
14
* Fix an edge case where the Dart VM could hang when shutting down when requests
15
15
were in flight.
16
16
17
+ * Fix a race condition where the embedded host could fail to shut down if it was
18
+ closed around the same time a new compilation was started.
19
+
17
20
## 1.77.8
18
21
19
22
* No user-visible changes.
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class IsolateDispatcher {
27
27
/// All isolates that have been spawned to dispatch to.
28
28
///
29
29
/// Only used for cleaning up the process when the underlying channel closes.
30
- final _allIsolates = < Future < ReusableIsolate >> [] ;
30
+ final _allIsolates = StreamController < ReusableIsolate >() ;
31
31
32
32
/// The isolates that aren't currently running compilations
33
33
final _inactiveIsolates = < ReusableIsolate > {};
@@ -87,10 +87,8 @@ class IsolateDispatcher {
87
87
}
88
88
}, onError: (Object error, StackTrace stackTrace) {
89
89
_handleError (error, stackTrace);
90
- }, onDone: () async {
91
- for (var isolate in _allIsolates) {
92
- (await isolate).kill ();
93
- }
90
+ }, onDone: () {
91
+ _allIsolates.stream.listen ((isolate) => isolate.kill ());
94
92
});
95
93
}
96
94
@@ -106,8 +104,8 @@ class IsolateDispatcher {
106
104
_inactiveIsolates.remove (isolate);
107
105
} else {
108
106
var future = ReusableIsolate .spawn (_isolateMain);
109
- _allIsolates.add (future);
110
107
isolate = await future;
108
+ _allIsolates.add (isolate);
111
109
}
112
110
113
111
_activeIsolates[compilationId] = isolate;
You can’t perform that action at this time.
0 commit comments