From 81f05d63c1a4ae484129b9b890ac8e35c2ddd54c Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Wed, 22 Jun 2022 14:48:45 -0300 Subject: [PATCH] Move destructor back to .cpp file Having it there (even defaulted, like this) means endpoint.hpp doesn't have to include endpoint_state.hpp (which it otherwise would need, because of the std::unique_ptr default deleter requirements). --- llarp/service/endpoint.cpp | 4 ++++ llarp/service/endpoint.hpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/llarp/service/endpoint.cpp b/llarp/service/endpoint.cpp index 3c266c247..84c10f2e8 100644 --- a/llarp/service/endpoint.cpp +++ b/llarp/service/endpoint.cpp @@ -587,6 +587,10 @@ namespace llarp return true; } + // Keep this here (rather than the header) so that we don't need to include endpoint_state.hpp + // in endpoint.hpp for the unique_ptr member destructor. + Endpoint::~Endpoint() = default; + bool Endpoint::PublishIntroSet(const EncryptedIntroSet& introset, AbstractRouter* r) { diff --git a/llarp/service/endpoint.hpp b/llarp/service/endpoint.hpp index 296f107af..a90752961 100644 --- a/llarp/service/endpoint.hpp +++ b/llarp/service/endpoint.hpp @@ -7,7 +7,6 @@ #include #include #include "address.hpp" -#include "endpoint_state.hpp" #include "handler.hpp" #include "identity.hpp" #include "pendingbuffer.hpp" @@ -62,6 +61,7 @@ namespace llarp public EndpointBase { Endpoint(AbstractRouter* r, Context* parent); + ~Endpoint() override; /// return true if we are ready to recv packets from the void bool