diff --git a/indexer/index.hpp b/indexer/index.hpp index c47fc95605..406e4bc560 100644 --- a/indexer/index.hpp +++ b/indexer/index.hpp @@ -151,8 +151,11 @@ private: } else { - if (++m_QueriesSkipped > 8) - Close(); + if (m_pIndex) + { + if (++m_QueriesSkipped > 8) + Close(); + } return NULL; } } @@ -167,6 +170,17 @@ private: Close(); } + void Close() + { + if (m_pIndex) + { + // LOG(LINFO, (m_Path)); + delete m_pIndex; + m_pIndex = NULL; + m_QueriesSkipped = 0; + } + } + private: void Open() @@ -181,16 +195,6 @@ private: } } - void Close() - { - if (m_pIndex) - { - // LOG(LINFO, (m_Path)); - delete m_pIndex; - m_pIndex = NULL; - } - } - m2::RectD m_Rect; string m_Path; // TODO: Store prefix and suffix of path in MultiIndexAdapter. IndexT * m_pIndex;