Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2012-07-20 09:09:15 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:41:16 +0300
commit86330091629199f15fba4f1de0ca698c112300e0 (patch)
tree388d96664a48d0aa832230918864295a94cfcf30 /indexer/mwm_set.cpp
parent0e6fe9465b46ccf499a9f71cb48aaea2b2c106cb (diff)
Fix issue when mwm file is an invalid map (file is broken), we should delete it by request too.
Diffstat (limited to 'indexer/mwm_set.cpp')
-rw-r--r--indexer/mwm_set.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/indexer/mwm_set.cpp b/indexer/mwm_set.cpp
index 32dc71e1d8..12d34e5dc5 100644
--- a/indexer/mwm_set.cpp
+++ b/indexer/mwm_set.cpp
@@ -90,12 +90,19 @@ MwmSet::MwmId MwmSet::GetFreeId()
MwmSet::MwmId MwmSet::GetIdByName(string const & name)
{
+ ASSERT ( !name.empty(), () );
+
for (MwmId i = 0; i < m_info.size(); ++i)
{
UpdateMwmInfo(i);
+
if (m_name[i] == name)
+ {
+ ASSERT_NOT_EQUAL ( m_info[i].m_status, MwmInfo::STATUS_REMOVED, () );
return i;
+ }
}
+
return INVALID_MWM_ID;
}
@@ -167,10 +174,10 @@ void MwmSet::Remove(string const & fileName)
bool MwmSet::RemoveImpl(string const & fileName)
{
- bool ret = false;
+ bool ret = true;
MwmId const id = GetIdByName(fileName);
- if (id != INVALID_MWM_ID && m_info[id].IsExist())
+ if (id != INVALID_MWM_ID)
{
ret = RemoveImpl(id);