close sinks cleanup (#5838)

part of https://github.com/flutter/flutter/issues/5789
This commit is contained in:
Dan Rubel
2016-09-13 14:15:36 -04:00
committed by GitHub
parent 3e2a52bc21
commit 672d04e0d0
5 changed files with 33 additions and 2 deletions

View File

@@ -636,7 +636,11 @@ class AnalysisServer {
_errorsController.add(new FileAnalysisErrors(file, errors));
}
Future<bool> dispose() async => _process?.kill();
Future<bool> dispose() async {
await _analyzingController.close();
await _errorsController.close();
return _process?.kill();
}
}
class FileAnalysisErrors {

View File

@@ -100,7 +100,10 @@ class Daemon {
// Start listening.
commandStream.listen(
(Map<String, dynamic> request) => _handleRequest(request),
onDone: () => _onExitCompleter.complete(0)
onDone: () {
if (!_onExitCompleter.isCompleted)
_onExitCompleter.complete(0);
}
);
}
@@ -579,6 +582,10 @@ class NotifyingLogger extends Logger {
printStatus(message);
return new Status();
}
void dispose() {
_messageController.close();
}
}
/// A running application, started by this daemon.