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>2015-09-25 16:09:20 +0300
committervng <viktor.govako@gmail.com>2015-09-25 17:17:51 +0300
commitc56f4c20b946bf62831e917a695d4e6c7861fdd9 (patch)
treed98919a12647ac1d6e8365a60896aa4744ac12f4 /map/feature_vec_model.cpp
parent7629852c751575bec7f407e2aab4fa4f3c2cde8a (diff)
[mwm set] Do not create MwmHandle instantly after registering map.
Diffstat (limited to 'map/feature_vec_model.cpp')
-rw-r--r--map/feature_vec_model.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/map/feature_vec_model.cpp b/map/feature_vec_model.cpp
index f28c8e65e1..65812a5c54 100644
--- a/map/feature_vec_model.cpp
+++ b/map/feature_vec_model.cpp
@@ -44,7 +44,7 @@ void FeaturesFetcher::InitClassificator()
}
}
-pair<MwmSet::MwmHandle, MwmSet::RegResult> FeaturesFetcher::RegisterMap(
+pair<MwmSet::MwmId, MwmSet::RegResult> FeaturesFetcher::RegisterMap(
LocalCountryFile const & localFile)
{
try
@@ -54,17 +54,20 @@ pair<MwmSet::MwmHandle, MwmSet::RegResult> FeaturesFetcher::RegisterMap(
{
LOG(LWARNING, ("Can't add map", localFile.GetCountryName(),
"Probably it's already added or has newer data version."));
- return result;
}
- MwmSet::MwmHandle & handle = result.first;
- ASSERT(handle.IsAlive(), ("Mwm lock invariant violation."));
- m_rect.Add(handle.GetInfo()->m_limitRect);
+ else
+ {
+ MwmSet::MwmId const & id = result.first;
+ ASSERT(id.IsAlive(), ());
+ m_rect.Add(id.GetInfo()->m_limitRect);
+ }
+
return result;
}
catch (RootException const & ex)
{
- LOG(LERROR, ("IO error while adding ", localFile.GetCountryName(), " map. ", ex.Msg()));
- return make_pair(MwmSet::MwmHandle(), MwmSet::RegResult::BadFile);
+ LOG(LERROR, ("IO error while adding", localFile.GetCountryName(), "map.", ex.Msg()));
+ return make_pair(MwmSet::MwmId(), MwmSet::RegResult::BadFile);
}
}