diff options
author | Raph Levien <raph@google.com> | 2014-05-19 13:21:21 -0700 |
---|---|---|
committer | Raph Levien <raph@google.com> | 2014-05-19 14:01:37 -0700 |
commit | c31e3883456e018d742e9f29815ba5ff8b315ea1 (patch) | |
tree | ca0e5d7f03ad7a06496c89c432220d5f08c0d80e /libs/minikin/FontCollection.cpp | |
parent | a3998d4f51e862f00b3dc6b8b99cfbeea2622b2d (diff) | |
download | android_frameworks_minikin-c31e3883456e018d742e9f29815ba5ff8b315ea1.tar.gz android_frameworks_minikin-c31e3883456e018d742e9f29815ba5ff8b315ea1.tar.bz2 android_frameworks_minikin-c31e3883456e018d742e9f29815ba5ff8b315ea1.zip |
Fix incomplete refcounting and locking
These changes were supposed to be committed in the previous patch
"Better refcounting and locking" but seem to have gotten lost in a
rebase. It fixes a memory leak and some possible race conditions.
Change-Id: I54ca1e37500ec49756fe317cc6d6d03da9911501
Diffstat (limited to 'libs/minikin/FontCollection.cpp')
-rw-r--r-- | libs/minikin/FontCollection.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/minikin/FontCollection.cpp b/libs/minikin/FontCollection.cpp index 18e528e..cd7b19e 100644 --- a/libs/minikin/FontCollection.cpp +++ b/libs/minikin/FontCollection.cpp @@ -19,6 +19,7 @@ #define LOG_TAG "Minikin" #include <cutils/log.h> +#include "MinikinInternal.h" #include <minikin/CmapCoverage.h> #include <minikin/FontCollection.h> @@ -33,6 +34,7 @@ static inline T max(T a, T b) { FontCollection::FontCollection(const vector<FontFamily*>& typefaces) : mMaxChar(0) { + AutoMutex _l(gMinikinLock); vector<uint32_t> lastChar; size_t nTypefaces = typefaces.size(); #ifdef VERBOSE_DEBUG |