Fix bug 6558006: SystemUI native heap is huge. Fix memory leak

TextLayoutCache was leaking HB_Face objects, not freeing them when
purging the mCachedHBFaces cache. More full analysis is in the bug.

Change-Id: Ie5cd8b00c36b9d31963183c601cde49cbb73fafb
This commit is contained in:
Raph Levien
2012-06-02 15:47:29 -07:00
committed by The Android Automerger
parent 2cd87a13fc
commit e5fe8f85f9

View File

@@ -992,6 +992,10 @@ HB_Face TextLayoutShaper::getCachedHBFace(SkTypeface* typeface) {
}
void TextLayoutShaper::purgeCaches() {
size_t cacheSize = mCachedHBFaces.size();
for (size_t i = 0; i < cacheSize; i++) {
HB_FreeFace(mCachedHBFaces.valueAt(i));
}
mCachedHBFaces.clear();
unrefTypefaces();
init();