[qt] Fixed crash in Downloader after second click on downloading country

This commit is contained in:
Alex Zolotarev 2011-03-25 16:05:08 +00:00 committed by Alex Zolotarev
parent cfa4df707a
commit 1074e27244

View file

@ -257,6 +257,8 @@ namespace storage
{
Country const & country = CountryByIndex(index);
m2::RectD bounds;
// check if we already downloading this country
TQueue::iterator found = find(m_queue.begin(), m_queue.end(), index);
if (found != m_queue.end())
@ -274,14 +276,18 @@ namespace storage
m_queue.erase(found);
}
}
else
{
// bounds are only updated if country was already activated before
bounds = country.Bounds();
}
m2::RectD bounds = country.Bounds();
// @TODO: Do not delete pieces which are used by other countries
DeactivateAndDeleteCountry(country, m_removeMap);
if (m_observerChange)
m_observerChange(index);
m_updateRect(bounds);
if (bounds != m2::RectD::GetEmptyRect())
m_updateRect(bounds);
}
void Storage::ReInitCountries(bool forceReload)