From 13416e114c3b35e0f8aab11a1c78daf0d7e0df38 Mon Sep 17 00:00:00 2001 From: vng Date: Mon, 9 Jul 2012 17:39:30 -0700 Subject: [PATCH] Logging exception in Framework::GetSearchEngine(). --- map/framework.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/map/framework.cpp b/map/framework.cpp index 505f813201..0bc52d0cd4 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -927,22 +927,24 @@ void Framework::StopScale(ScaleEvent const & e) search::Engine * Framework::GetSearchEngine() const { - // Classical "double check" synchronization pattern. if (!m_pSearchEngine) { - //threads::MutexGuard lock(m_modelSyn); - if (!m_pSearchEngine) - { - Platform & pl = GetPlatform(); + Platform & pl = GetPlatform(); - m_pSearchEngine.reset( - new search::Engine(&m_model.GetIndex(), + try + { + m_pSearchEngine.reset(new search::Engine(&m_model.GetIndex(), pl.GetReader(SEARCH_CATEGORIES_FILE_NAME), pl.GetReader(PACKED_POLYGONS_FILE), pl.GetReader(COUNTRIES_FILE), languages::CurrentLanguage())); } + catch (RootException const & e) + { + LOG(LCRITICAL, ("Can't load needed resources for search::Engine: ", e.Msg())); + } } + return m_pSearchEngine.get(); }