Fix a race in runFromSource. (#9495)
There is a race where we could complete a future based on a stream event and then before we cancel the stream subscription, we get another event and try and complete the future again.
This commit is contained in:
@@ -1124,7 +1124,8 @@ class FlutterView extends ServiceObject {
|
||||
// launch errors.
|
||||
if (event.kind == ServiceEvent.kIsolateRunnable) {
|
||||
printTrace('Isolate is runnable.');
|
||||
completer.complete(null);
|
||||
if (!completer.isCompleted)
|
||||
completer.complete(null);
|
||||
}
|
||||
});
|
||||
await owner.vm.runInView(viewId,
|
||||
|
||||
Reference in New Issue
Block a user