From 733831c30e541650d02aaef8198abebc073c95f8 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 30 Apr 2025 14:46:47 +0200 Subject: [PATCH] fix: release fd from stream_descriptor to prevent double or prematurely close --- src/executor_asio.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/executor_asio.cpp b/src/executor_asio.cpp index 4cdbc7c..8c084a4 100644 --- a/src/executor_asio.cpp +++ b/src/executor_asio.cpp @@ -622,6 +622,8 @@ struct watcher_impl { : ctx{strand.ref->ctx}, strand_{strand.ref->strand_}, fd_{*ctx->asio, fd} {} + ~watcher_impl() { fd_.release(); } + void wait_read(watcher::handler h) { if (!read_in_progress_) { read_in_progress_ = true;