From 1074e272443fc7ce3bd089737478956fc0d20d32 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Fri, 25 Mar 2011 16:05:08 +0000 Subject: [PATCH] [qt] Fixed crash in Downloader after second click on downloading country --- storage/storage.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/storage/storage.cpp b/storage/storage.cpp index 2cff14c088..6e77d5ae3c 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -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)