mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
proxy client: move callbacks to lambda
This commit is contained in:
1 parent
ae2445fd07
commit
a24dedd225
1 file changed
+4
-4
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user