mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 20:19:23 +00:00
Close pub http client in finally block
Change-Id: I63efbdbcaeef787d07ce38c44d30425cdc96c65d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362360 Reviewed-by: Jonas Jensen <jonasfj@google.com> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
This commit is contained in:
parent
7998c4297b
commit
6eb220bbcf
|
@ -9,8 +9,11 @@ import 'package:pub/src/http.dart';
|
|||
|
||||
/// The entry point for dartdev.
|
||||
Future<void> main(List<String> args, SendPort? port) async {
|
||||
await runDartdev(args, port);
|
||||
// TODO(https://github.com/dart-lang/pub/issues/4209). Handle this in a more
|
||||
// structured way.
|
||||
globalHttpClient.close();
|
||||
try {
|
||||
await runDartdev(args, port);
|
||||
} finally {
|
||||
// TODO(https://github.com/dart-lang/pub/issues/4209). Handle this in a more
|
||||
// structured way.
|
||||
globalHttpClient.close();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue