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:
Diffstat (limited to 'indexer')
-rw-r--r--indexer/features_offsets_table.cpp2
-rw-r--r--indexer/indexer_tests/features_offsets_table_test.cpp2
-rw-r--r--indexer/mwm_set.cpp14
3 files changed, 15 insertions, 3 deletions
diff --git a/indexer/features_offsets_table.cpp b/indexer/features_offsets_table.cpp
index 2850a73cde..2b6d9e19fe 100644
--- a/indexer/features_offsets_table.cpp
+++ b/indexer/features_offsets_table.cpp
@@ -71,7 +71,7 @@ namespace feature
{
LOG(LINFO, ("Creating features offset table file", storePath));
- VERIFY(CountryIndexes::PreparePlaceOnDisk(localFile), ());
+ CountryIndexes::PreparePlaceOnDisk(localFile);
Builder builder;
FeaturesVector::ForEachOffset(cont.GetReader(DATA_FILE_TAG), [&builder] (uint32_t offset)
diff --git a/indexer/indexer_tests/features_offsets_table_test.cpp b/indexer/indexer_tests/features_offsets_table_test.cpp
index d08cca7486..f995cd673c 100644
--- a/indexer/indexer_tests/features_offsets_table_test.cpp
+++ b/indexer/indexer_tests/features_offsets_table_test.cpp
@@ -97,7 +97,7 @@ namespace feature
FilesContainerR baseContainer(pl.GetReader("minsk-pass" DATA_FILE_EXTENSION));
LocalCountryFile localFile = LocalCountryFile::MakeForTesting(testFileName);
- TEST(CountryIndexes::PreparePlaceOnDisk(localFile), ());
+ CountryIndexes::PreparePlaceOnDisk(localFile);
string const indexFile = CountryIndexes::GetPath(localFile, CountryIndexes::Index::Offsets);
FileWriter::DeleteFileX(indexFile);
diff --git a/indexer/mwm_set.cpp b/indexer/mwm_set.cpp
index 71d8bcef0e..1079ba19ff 100644
--- a/indexer/mwm_set.cpp
+++ b/indexer/mwm_set.cpp
@@ -4,6 +4,7 @@
#include "defines.hpp"
#include "base/assert.hpp"
+#include "base/exception.hpp"
#include "base/logging.hpp"
#include "base/stl_add.hpp"
@@ -214,7 +215,18 @@ unique_ptr<MwmSet::MwmValueBase> MwmSet::LockValueImpl(MwmId const & id)
}
}
- return CreateValue(*info);
+ try
+ {
+ return CreateValue(*info);
+ }
+ catch (exception const & ex)
+ {
+ LOG(LERROR, ("Can't create MWMValue for", info->GetCountryName(), "Reason", ex.what()));
+
+ --info->m_numRefs;
+ DeregisterImpl(id);
+ return nullptr;
+ }
}
void MwmSet::UnlockValue(MwmId const & id, unique_ptr<MwmValueBase> && p)