[pulsar-client] Fix pulsar-cpp crash on lookup timeout
@@ -1106,11 +1106,11 @@ void ClientConnection::newLookup(const SharedBuffer& cmd, const uint64_t request
return;
}
LookupRequestData requestData;
+ requestData.promise = promise;
requestData.timer = executor_->createDeadlineTimer();
requestData.timer->expires_from_now(operationsTimeout_);
requestData.timer->async_wait(std::bind(&ClientConnection::handleLookupTimeout, shared_from_this(),
std::placeholders::_1, requestData));
- requestData.promise = promise;
pendingLookupRequests_.insert(std::make_pair(requestId, requestData));
numOfPendingLookupRequest_++;
