jamiaccount: capture accountId to avoid bad_weak_ptr

Change-Id: I9321ffb6e409750609a7e7744bfe0f7437d5ffd3
This commit is contained in:
Adrien Béraud
2019-09-19 14:05:47 -04:00
parent 2e2728d950
commit 9826f7f205

View File

@ -1028,8 +1028,8 @@ JamiAccount::loadAccount(const std::string& archive_password, const std::string&
{
JAMI_WARN("Auth error: %d %s", (int)error, message.c_str());
setRegistrationState(RegistrationState::ERROR_GENERIC);
runOnMainThread([w = weak()] {
Manager::instance().removeAccount(w.lock()->getAccountID(), true);
runOnMainThread([id = getAccountID()] {
Manager::instance().removeAccount(id, true);
});
}, std::move(callbacks));
}