forked from organicmaps/organicmaps-tmp
Fix crash while switch traffic on/off
This commit is contained in:
parent
54c58c2606
commit
aca06a5f03
1 changed files with 12 additions and 1 deletions
|
@ -243,7 +243,13 @@ void TrafficManager::ThreadRoutine()
|
|||
|
||||
traffic::TrafficInfo info(mwm, m_currentDataVersion);
|
||||
|
||||
if (info.ReceiveTrafficData(m_trafficETags[mwm]))
|
||||
string tag;
|
||||
{
|
||||
lock_guard<mutex> lock(m_mutex);
|
||||
tag = m_trafficETags[mwm];
|
||||
}
|
||||
|
||||
if (info.ReceiveTrafficData(tag))
|
||||
{
|
||||
OnTrafficDataResponse(move(info));
|
||||
}
|
||||
|
@ -252,6 +258,11 @@ void TrafficManager::ThreadRoutine()
|
|||
LOG(LWARNING, ("Traffic request failed. Mwm =", mwm));
|
||||
OnTrafficRequestFailed(move(info));
|
||||
}
|
||||
|
||||
{
|
||||
lock_guard<mutex> lock(m_mutex);
|
||||
m_trafficETags[mwm] = tag;
|
||||
}
|
||||
}
|
||||
mwms.clear();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue