diff --git a/packages/custom_lint/CHANGELOG.md b/packages/custom_lint/CHANGELOG.md index e414b7c9..9263c47e 100644 --- a/packages/custom_lint/CHANGELOG.md +++ b/packages/custom_lint/CHANGELOG.md @@ -4,6 +4,7 @@ - Fix watch mode not quitting with `q` (thanks to @kuhnroyal) - Improve the command line's output (thanks to @kuhnroyal) - Update uuid to 4.0.0 +- Fixed a port leak ## 0.5.3 - 2023-08-29 diff --git a/packages/custom_lint/lib/src/v2/server_to_client_channel.dart b/packages/custom_lint/lib/src/v2/server_to_client_channel.dart index 47acdfdf..ccda5479 100644 --- a/packages/custom_lint/lib/src/v2/server_to_client_channel.dart +++ b/packages/custom_lint/lib/src/v2/server_to_client_channel.dart @@ -15,7 +15,11 @@ import 'protocol.dart'; Future _findPossiblyUnusedPort() { return SocketCustomLintServerToClientChannel._createServerSocket() - .then((value) => value.port); + .then((value) { + final port = value.port; + value.close(); + return port; + }); } Future _asyncRetry(