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

sipaccount: only create weak reference if it didn't exist

Change-Id: Ifedd141b70fdf31f07e4a1b572392fe71d62d589
parent b1649cbc
No related branches found
No related tags found
No related merge requests found
...@@ -961,6 +961,7 @@ SIPAccount::startKeepAliveTimer() ...@@ -961,6 +961,7 @@ SIPAccount::startKeepAliveTimer()
if (auto sipAccount = static_cast<std::weak_ptr<SIPAccount>*>(te->user_data)->lock()) if (auto sipAccount = static_cast<std::weak_ptr<SIPAccount>*>(te->user_data)->lock())
sipAccount->keepAliveRegistrationCb(); sipAccount->keepAliveRegistrationCb();
}; };
if (not keepAliveTimer_.user_data)
keepAliveTimer_.user_data = new std::weak_ptr<SIPAccount>(weak()); keepAliveTimer_.user_data = new std::weak_ptr<SIPAccount>(weak());
keepAliveTimer_.id = timerIdDist_(rand); keepAliveTimer_.id = timerIdDist_(rand);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment