From 57230bc42e3860980e7c0fb2e1fb246dfa3c64e4 Mon Sep 17 00:00:00 2001 From: rachytski Date: Tue, 15 Mar 2011 01:45:53 +0200 Subject: [PATCH] clearing caches on memoryWarning. --- map/feature_vec_model.cpp | 5 +++++ map/feature_vec_model.hpp | 1 + map/framework.hpp | 1 + 3 files changed, 7 insertions(+) diff --git a/map/feature_vec_model.cpp b/map/feature_vec_model.cpp index bb41422f07..5e55f54acf 100644 --- a/map/feature_vec_model.cpp +++ b/map/feature_vec_model.cpp @@ -53,6 +53,11 @@ void FeaturesFetcher::Clean() m_multiIndex.Clean(); } +void FeaturesFetcher::ClearCaches() +{ + m_multiIndex.ClearCaches(); +} + m2::RectD FeaturesFetcher::GetWorldRect() const { if (m_rect == m2::RectD()) diff --git a/map/feature_vec_model.hpp b/map/feature_vec_model.hpp index bc395a157b..2f8262716d 100644 --- a/map/feature_vec_model.hpp +++ b/map/feature_vec_model.hpp @@ -41,6 +41,7 @@ namespace model void AddMap(string const & fName); void RemoveMap(string const & fName); void Clean(); + void ClearCaches(); // process features by param type indices template diff --git a/map/framework.hpp b/map/framework.hpp index ffb936a8ed..30c21f7200 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -454,6 +454,7 @@ public: void MemoryWarning() { + m_model.ClearCaches(); m_informationDisplay.memoryWarning(); m_renderQueue.memoryWarning();