Skip to content

Commit

Permalink
Replace make_shared<UdpServer> with UdpServer::Ptr new.
Browse files Browse the repository at this point in the history
  • Loading branch information
PioLing authored Feb 22, 2024
1 parent 69d82e6 commit db556e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Network/UdpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<UdpServer>(poller);
return Ptr(new UdpServer(poller), [poller](UdpServer *ptr) { poller->async([ptr]() { delete ptr; }); });
}

void UdpServer::cloneFrom(const UdpServer &that) {
Expand Down

0 comments on commit db556e2

Please sign in to comment.