From 53f4c26c4682a951e084415a594fcb8d9494033f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 27 Nov 2021 22:29:53 +0100 Subject: Network: make Server non-copyable Avoids issues with shared_from_this and does not make much sense anyway. --- src/network.cpp | 3 ++- src/network.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/network.cpp b/src/network.cpp index 2db450c..1e95571 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -269,7 +269,8 @@ Server::Priv::~Priv() shared_ptr Server::Priv::getptr() { - return shared_from_this(); + // Creating temporary object, so just use null deleter + return shared_ptr(this, [](Priv *){}); } void Server::Priv::doListen() diff --git a/src/network.h b/src/network.h index c4f3d6f..b2cd8be 100644 --- a/src/network.h +++ b/src/network.h @@ -136,7 +136,7 @@ struct WaitingRef optional check(ReplyBuilder &); }; -struct Server::Priv : enable_shared_from_this +struct Server::Priv { Priv(const Head & local, const Identity & self, vector> && svcs); -- cgit v1.2.3