close sinks cleanup (#5838)
part of https://github.com/flutter/flutter/issues/5789
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user