diff --git a/Osmand-kernel/osmand/src/common.cpp b/Osmand-kernel/osmand/src/common.cpp index 39fc40f7fe..7cfc222f93 100644 --- a/Osmand-kernel/osmand/src/common.cpp +++ b/Osmand-kernel/osmand/src/common.cpp @@ -134,6 +134,13 @@ SkBitmap* getCachedBitmap(RenderingContext* rc, const std::string& bitmapResourc return iconBitmap; } +void purgeCachedBitmaps() { + HMAP::hash_map::iterator it = cachedBitmaps.begin(); + for (; it != cachedBitmaps.end(); it++) { + delete it->second; + } +} + std::string RenderingContext::getTranslatedString(const std::string& src) { return src; } diff --git a/Osmand-kernel/osmand/src/common.h b/Osmand-kernel/osmand/src/common.h index 38cb53a36e..08d88455f4 100644 --- a/Osmand-kernel/osmand/src/common.h +++ b/Osmand-kernel/osmand/src/common.h @@ -295,7 +295,7 @@ public: }; SkBitmap* getCachedBitmap(RenderingContext* rc, const std::string& bitmapResource); - +void purgeCachedBitmaps(); int get31TileNumberX(double longitude); int get31TileNumberY( double latitude); diff --git a/Osmand-kernel/osmand/src/osmand_main.cpp b/Osmand-kernel/osmand/src/osmand_main.cpp index e39a47e4e6..39a08ca858 100644 --- a/Osmand-kernel/osmand/src/osmand_main.cpp +++ b/Osmand-kernel/osmand/src/osmand_main.cpp @@ -328,4 +328,5 @@ int main(int argc, char **argv) { } SkGraphics::PurgeFontCache(); + purgeCachedBitmaps(); }