diff options
author | Yuri Gorshenin <y@maps.me> | 2016-06-03 00:29:19 +0300 |
---|---|---|
committer | Yuri Gorshenin <y@maps.me> | 2016-06-03 16:26:12 +0300 |
commit | 85ee45b48220988cb098e20268000d361434c4e2 (patch) | |
tree | 9f03f1c87d5c2fbae98821efde4029b7a6e17e15 /indexer/mwm_set.cpp | |
parent | 573021d80952bb9b82af4bac6b03622c7231b936 (diff) |
Review fixes.
Diffstat (limited to 'indexer/mwm_set.cpp')
-rw-r--r-- | indexer/mwm_set.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/indexer/mwm_set.cpp b/indexer/mwm_set.cpp index ba35b57051..a3e446dd55 100644 --- a/indexer/mwm_set.cpp +++ b/indexer/mwm_set.cpp @@ -1,7 +1,7 @@ #include "indexer/mwm_set.hpp" #include "indexer/scales.hpp" -#include "defines.hpp" +#include "coding/reader.hpp" #include "base/assert.hpp" #include "base/exception.hpp" @@ -11,6 +11,7 @@ #include "std/algorithm.hpp" #include "std/sstream.hpp" +#include "defines.hpp" using platform::CountryFile; using platform::LocalCountryFile; @@ -162,6 +163,14 @@ bool MwmSet::DeregisterImpl(MwmId const & id, EventList & events) SetStatus(*info, MwmInfo::STATUS_DEREGISTERED, events); vector<shared_ptr<MwmInfo>> & infos = m_info[info->GetCountryName()]; infos.erase(remove(infos.begin(), infos.end(), info), infos.end()); + for (auto it = m_cache.begin(); it != m_cache.end(); ++it) + { + if (it->first == id) + { + m_cache.erase(it); + break; + } + } return true; } @@ -284,6 +293,12 @@ unique_ptr<MwmSet::MwmValueBase> MwmSet::LockValueImpl(MwmId const & id, EventLi { return CreateValue(*info); } + catch (Reader::TooManyFilesException const & ex) + { + LOG(LERROR, ("Too many open files, can't open:", info->GetCountryName())); + --info->m_numRefs; + return nullptr; + } catch (exception const & ex) { LOG(LERROR, ("Can't create MWMValue for", info->GetCountryName(), "Reason", ex.what())); |