purge cached bitmaps on exit

This commit is contained in:
Jindřich Makovička 2012-05-13 10:27:32 +02:00
parent 6263b0e3bb
commit 74177e5421
3 changed files with 9 additions and 1 deletions

View file

@ -134,6 +134,13 @@ SkBitmap* getCachedBitmap(RenderingContext* rc, const std::string& bitmapResourc
return iconBitmap;
}
void purgeCachedBitmaps() {
HMAP::hash_map<std::string, SkBitmap*>::iterator it = cachedBitmaps.begin();
for (; it != cachedBitmaps.end(); it++) {
delete it->second;
}
}
std::string RenderingContext::getTranslatedString(const std::string& src) {
return src;
}

View file

@ -295,7 +295,7 @@ public:
};
SkBitmap* getCachedBitmap(RenderingContext* rc, const std::string& bitmapResource);
void purgeCachedBitmaps();
int get31TileNumberX(double longitude);
int get31TileNumberY( double latitude);

View file

@ -328,4 +328,5 @@ int main(int argc, char **argv) {
}
SkGraphics::PurgeFontCache();
purgeCachedBitmaps();
}