Skip to content
Snippets Groups Projects
Commit a24dedd2 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

proxy client: move callbacks to lambda

parent ae2445fd
No related branches found
No related tags found
No related merge requests found
......@@ -725,10 +725,10 @@ DhtProxyClient::onProxyInfos(const Json::Value& proxyInfos, const sa_family_t fa
listenerRestartTimer_->async_wait(std::bind(&DhtProxyClient::restartListeners, this, std::placeholders::_1));
if (not onConnectCallbacks_.empty()) {
std::lock_guard<std::mutex> lock(lockCallbacks_);
callbacks_.emplace_back([this] {
while (not onConnectCallbacks_.empty()) {
auto cb = std::move(onConnectCallbacks_.front());
onConnectCallbacks_.pop();
callbacks_.emplace_back([cbs = std::move(onConnectCallbacks_)]() mutable {
while (not cbs.empty()) {
auto cb = std::move(cbs.front());
cbs.pop();
cb();
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment