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:
Sigurd Meldgaard 2024-04-11 13:53:08 +00:00 committed by Commit Queue
parent 7998c4297b
commit 6eb220bbcf

View file

@ -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();
}
}