Skip to content
Snippets Groups Projects
Commit 02b14249 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

connectionmanager: move ice destruction and cleanup

Change-Id: Ia781eae9ace1fbabed4d353e1d43bfe1093f88d3
parent 6927411c
No related branches found
No related tags found
No related merge requests found
......@@ -88,10 +88,8 @@ public:
if (!erased)
++it;
}
if (!deviceId) {
dht::ThreadPool::io().run([infos = std::make_shared<decltype(infos_)>(
std::move(infos_))] { infos->clear(); });
}
if (!deviceId)
dht::ThreadPool::io().run([infos = std::move(infos_)]() mutable { infos.clear(); });
}
void shutdown()
{
......@@ -733,10 +731,8 @@ ConnectionManager::Impl::onDhtPeerRequest(const PeerConnectionRequest& req,
}
std::unique_lock<std::mutex> lk {info->mutex_};
info->ice_ = Manager::instance()
.getIceTransportFactory().createUTransport(account.getAccountID().c_str(),
1,
true,
ice_config);
.getIceTransportFactory()
.createUTransport(account.getAccountID().c_str(), 1, true, ice_config);
if (not info->ice_) {
JAMI_ERR("Cannot initialize ICE session.");
if (connReadyCb_)
......@@ -849,7 +845,8 @@ ConnectionManager::closeConnectionsWith(const DeviceId& deviceId)
info->responseCv_.notify_all();
if (info->ice_) {
std::unique_lock<std::mutex> lk {info->mutex_};
info->ice_.reset();
dht::ThreadPool::io().run(
[ice = std::shared_ptr<IceTransport>(std::move(info->ice_))] {});
}
}
// This will close the TLS Session
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment