File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -90,11 +90,9 @@ ${result.stderr}
9090 ]);
9191 final uriCompleter = Completer <String >();
9292 final uriRegExp = RegExp ('Serving `web` on (http://.*)' );
93- late StreamSubscription <String > sub;
94- sub = process.stdout.transform (utf8.decoder).listen ((e) {
93+ final sub = process.stdout.transform (utf8.decoder).listen ((e) {
9594 if (uriRegExp.hasMatch (e)) {
9695 uriCompleter.complete (uriRegExp.firstMatch (e)! .group (1 ));
97- sub.cancel ();
9896 }
9997 });
10098
@@ -105,6 +103,11 @@ ${result.stderr}
105103 Chrome .start (< String > [observatoryUri]);
106104 }
107105 await process.exitCode;
106+
107+ // Don't cancel this stream until the process has exited as it will close
108+ // the file descriptor for stdout and cause a crash when webdev tries to
109+ // write logs.
110+ await sub.cancel ();
108111 }
109112
110113 String _findObservatoryProjectRoot () {
Original file line number Diff line number Diff line change 44
55import 'package:web/web.dart' ;
66import 'package:logging/logging.dart' ;
7- import '../lib /elements.dart' ;
7+ import 'package:observatory /elements.dart' ;
88import 'package:stack_trace/stack_trace.dart' ;
99
1010main () async {
You can’t perform that action at this time.
0 commit comments