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

ConnectionManager: avoid handling shutdown twice

Only process the callback if it was not already done by the tls
shutdown callback.

Change-Id: Iee9b479100268c4815f40f7b5d51b9db7dbb22cd
parent 8cd00200
Branches
No related tags found
No related merge requests found
......@@ -980,7 +980,7 @@ ConnectionManager::Impl::startConnection(const std::shared_ptr<DeviceInfo>& di,
auto eraseInfo = [w = weak_from_this(), diw=std::weak_ptr(di), vid] {
if (auto di = diw.lock()) {
std::unique_lock lk(di->mutex_);
di->info.erase(vid);
if (di->info.erase(vid)) {
auto ops = di->extractPendingOperations(vid, nullptr);
if (di->empty()) {
if (auto shared = w.lock())
......@@ -990,6 +990,7 @@ ConnectionManager::Impl::startConnection(const std::shared_ptr<DeviceInfo>& di,
for (const auto& op: ops)
op.cb(nullptr, di->deviceId);
}
}
};
auto info = std::make_shared<ConnectionInfo>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment