From 749aa520c996bfb5c7690452c0f0c44a0f5fba1e Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Mon, 15 Apr 2024 08:34:38 +0000 Subject: [PATCH] [beta] Shut down pub http client after running dartdev Bug: https://github.com/dart-lang/sdk/issues/55289 Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/361364 Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/362360 Cherry-pick-request: https://github.com/dart-lang/sdk/issues/55402 Change-Id: I61548d0b223167b769a27ac6ab956c4fd42a7be6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361562 Reviewed-by: Ben Konyi Commit-Queue: Sigurd Meldgaard --- pkg/dartdev/bin/dartdev.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/dartdev/bin/dartdev.dart b/pkg/dartdev/bin/dartdev.dart index 7c096eef57c1..10751b1ca730 100644 --- a/pkg/dartdev/bin/dartdev.dart +++ b/pkg/dartdev/bin/dartdev.dart @@ -5,8 +5,15 @@ import 'dart:isolate'; import 'package:dartdev/dartdev.dart'; +import 'package:pub/src/http.dart'; /// The entry point for dartdev. Future main(List args, SendPort? port) async { - await runDartdev(args, port); + try { + await runDartdev(args, port); + } finally { + // TODO(https://github.com/dart-lang/pub/issues/4209). Handle this in a more + // structured way. + globalHttpClient.close(); + } }