fix: release fd from stream_descriptor to prevent double or prematurely close

This commit is contained in:
CJ van den Berg 2025-04-30 14:46:47 +02:00
parent 42a98a44e7
commit 733831c30e
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -622,6 +622,8 @@ struct watcher_impl {
: ctx{strand.ref->ctx}, strand_{strand.ref->strand_}, : ctx{strand.ref->ctx}, strand_{strand.ref->strand_},
fd_{*ctx->asio, fd} {} fd_{*ctx->asio, fd} {}
~watcher_impl() { fd_.release(); }
void wait_read(watcher::handler h) { void wait_read(watcher::handler h) {
if (!read_in_progress_) { if (!read_in_progress_) {
read_in_progress_ = true; read_in_progress_ = true;