forked from firka/flutter
Ensure to close connection to VM after collecting coverage (#50943)
This commit is contained in:
committed by
GitHub
parent
11589ca20d
commit
d2947571bd
@@ -181,7 +181,10 @@ Future<Map<String, dynamic>> collect(Uri serviceUri, bool Function(String) libra
|
||||
}) async {
|
||||
final VMService vmService = await connector(serviceUri);
|
||||
await vmService.getVM();
|
||||
return _getAllCoverage(vmService, libraryPredicate);
|
||||
final Map<String, dynamic> result = await _getAllCoverage(
|
||||
vmService, libraryPredicate);
|
||||
await vmService.close();
|
||||
return result;
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> _getAllCoverage(VMService service, bool Function(String) libraryPredicate) async {
|
||||
|
||||
@@ -452,6 +452,8 @@ class VMService {
|
||||
Future<void> getVM() async => await vm.reload();
|
||||
|
||||
Future<void> refreshViews({ bool waitForViews = false }) => vm.refreshViews(waitForViews: waitForViews);
|
||||
|
||||
Future<void> close() async => await _peer.close();
|
||||
}
|
||||
|
||||
/// An error that is thrown when constructing/updating a service object.
|
||||
|
||||
Reference in New Issue
Block a user