mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-29 08:05:50 +00:00
fix: make session::subscriptions_ a weak_ptr
This commit is contained in:
@@ -172,7 +172,7 @@ class session : public std::enable_shared_from_this<session>
|
|||||||
std::string response_;
|
std::string response_;
|
||||||
|
|
||||||
std::shared_ptr<BackendInterface> backend_;
|
std::shared_ptr<BackendInterface> backend_;
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions_;
|
std::weak_ptr<SubscriptionManager> subscriptions_;
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer_;
|
std::shared_ptr<ETLLoadBalancer> balancer_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -295,10 +295,13 @@ private:
|
|||||||
BOOST_LOG_TRIVIAL(debug) << " received request : " << request;
|
BOOST_LOG_TRIVIAL(debug) << " received request : " << request;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (subscriptions_.expired())
|
||||||
|
return;
|
||||||
|
|
||||||
response = buildResponse(
|
response = buildResponse(
|
||||||
request,
|
request,
|
||||||
backend_,
|
backend_,
|
||||||
subscriptions_,
|
subscriptions_.lock(),
|
||||||
balancer_,
|
balancer_,
|
||||||
shared_from_this());
|
shared_from_this());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user