summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/src/vespa/config/frt/frtconnection.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/config/src/vespa/config/frt/frtconnection.cpp b/config/src/vespa/config/frt/frtconnection.cpp
index 466239200d4..be8ccead65c 100644
--- a/config/src/vespa/config/frt/frtconnection.cpp
+++ b/config/src/vespa/config/frt/frtconnection.cpp
@@ -28,7 +28,6 @@ FRTConnection::FRTConnection(const vespalib::string& address, FRT_Supervisor& su
FRTConnection::~FRTConnection()
{
- std::lock_guard guard(_lock);
if (_target != nullptr) {
LOG(debug, "Shutting down %s", _address.c_str());
_target->SubRef();
@@ -46,13 +45,16 @@ FRTConnection::getTarget()
_target->SubRef();
_target = _supervisor.GetTarget(_address.c_str());
}
+ _target->AddRef();
return _target;
}
void
FRTConnection::invoke(FRT_RPCRequest * req, duration timeout, FRT_IRequestWait * waiter)
{
- getTarget()->InvokeAsync(req, vespalib::to_s(timeout), waiter);
+ FRT_Target * target = getTarget();
+ target->InvokeAsync(req, vespalib::to_s(timeout), waiter);
+ target->SubRef();
}
void