Index: src/core/SkTypefaceCache.cpp |
diff --git a/src/core/SkTypefaceCache.cpp b/src/core/SkTypefaceCache.cpp |
index b75b2a9af95db764af35102b0b36c2a9a2f0a1e2..f864e1c9dc5105b4961eacd0253c48c7a18a67d8 100644 |
--- a/src/core/SkTypefaceCache.cpp |
+++ b/src/core/SkTypefaceCache.cpp |
@@ -13,6 +13,21 @@ |
#define TYPEFACE_CACHE_LIMIT 1024 |
+SkTypefaceCache::SkTypefaceCache() {} |
+ |
+SkTypefaceCache::~SkTypefaceCache() { |
+ const Rec* curr = fArray.begin(); |
+ const Rec* stop = fArray.end(); |
+ while (curr < stop) { |
+ if (curr->fStrong) { |
+ curr->fFace->unref(); |
+ } else { |
+ curr->fFace->weak_unref(); |
+ } |
+ curr += 1; |
+ } |
+} |
+ |
void SkTypefaceCache::add(SkTypeface* face, |
SkTypeface::Style requestedStyle, |
bool strong) { |