diff --git a/src/Network/UdpServer.cpp b/src/Network/UdpServer.cpp index dfaab881..9b120ce1 100644 --- a/src/Network/UdpServer.cpp +++ b/src/Network/UdpServer.cpp @@ -121,7 +121,7 @@ void UdpServer::start_l(uint16_t port, const std::string &host) { } UdpServer::Ptr UdpServer::onCreatServer(const EventPoller::Ptr &poller) { - return std::make_shared(poller); + return Ptr(new UdpServer(poller), [poller](UdpServer *ptr) { poller->async([ptr]() { delete ptr; }); }); } void UdpServer::cloneFrom(const UdpServer &that) {