mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
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:
parent
f29dd4f921
commit
03d684be6d
@ -1124,6 +1124,7 @@ class FlutterView extends ServiceObject {
|
|||||||
// launch errors.
|
// launch errors.
|
||||||
if (event.kind == ServiceEvent.kIsolateRunnable) {
|
if (event.kind == ServiceEvent.kIsolateRunnable) {
|
||||||
printTrace('Isolate is runnable.');
|
printTrace('Isolate is runnable.');
|
||||||
|
if (!completer.isCompleted)
|
||||||
completer.complete(null);
|
completer.complete(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user