diff --git a/src/comm.cc b/src/comm.cc index 24fe6ce462c..c5f4751bc78 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1154,9 +1154,6 @@ comm_init(void) { assert(fd_table); - /* make sure the accept() socket FIFO delay queue exists */ - Comm::AcceptLimiter::Instance(); - // make sure the IO pending callback table exists Comm::CallbackTableInit(); diff --git a/src/comm/AcceptLimiter.cc b/src/comm/AcceptLimiter.cc index a303592b899..6df2bd2a058 100644 --- a/src/comm/AcceptLimiter.cc +++ b/src/comm/AcceptLimiter.cc @@ -13,12 +13,11 @@ #include "fde.h" #include "globals.h" -Comm::AcceptLimiter Comm::AcceptLimiter::Instance_; - Comm::AcceptLimiter & Comm::AcceptLimiter::Instance() { - return Instance_; + static const auto Instance_ = new AcceptLimiter(); + return *Instance_; } void diff --git a/src/comm/AcceptLimiter.h b/src/comm/AcceptLimiter.h index 6f18c9a8b1c..e5e1435ccc4 100644 --- a/src/comm/AcceptLimiter.h +++ b/src/comm/AcceptLimiter.h @@ -43,8 +43,6 @@ class AcceptLimiter void kick(); private: - static AcceptLimiter Instance_; - /** FIFO queue */ std::deque deferred_; };