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

account: avoid calling hangup with mutex locked

A shared_ptr<Call> could be deleted during call to hangup,
causing call to detachCall() and deadlock.

Copy id set to avoid potential deadlock.

Change-Id: Ic43280351f19408fc308362f3d287090b90c736d
parent bcc75c7f
No related branches found
No related tags found
No related merge requests found
......@@ -135,9 +135,13 @@ Account::detachCall(const std::string& id)
void
Account::freeAccount()
{
decltype(callIDSet_) calls;
{
std::lock_guard<std::mutex> lk {callIDSetMtx_};
for (const auto& id : callIDSet_)
calls = callIDSet_;
}
for (const auto& id : calls)
Manager::instance().hangupCall(id);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment