From 2eb0c806aeea9fb7f6f8d19035ad9bb1e4e0cfd1 Mon Sep 17 00:00:00 2001 From: absurdfarce Date: Thu, 12 Mar 2026 14:29:25 -0500 Subject: [PATCH] Do not make on_close() a pure virtual void fn. Also avoid the callback in shutdown situations in order to avoid taking longer than we need to. --- src/connection.hpp | 2 +- src/prepare_host_handler.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/connection.hpp b/src/connection.hpp index 512967011..e82af8307 100644 --- a/src/connection.hpp +++ b/src/connection.hpp @@ -87,7 +87,7 @@ class ConnectionListener { * * @param connection The closing connection. */ - virtual void on_close(Connection* connection) = 0; + virtual void on_close(Connection* connection) {}; }; /** diff --git a/src/prepare_host_handler.cpp b/src/prepare_host_handler.cpp index 8a03661c7..8616fe08c 100644 --- a/src/prepare_host_handler.cpp +++ b/src/prepare_host_handler.cpp @@ -69,8 +69,6 @@ void PrepareHostHandler::prepare(uv_loop_t* loop, const ConnectionSettings& sett } void PrepareHostHandler::on_close(Connection* connection) { - callback_(this); - dec_ref(); // The event loop is done with this handler }