diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-22 18:45:12 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-22 18:45:12 +0000 |
commit | 750a24bb3d39e59d32db3f166ad3f39c7560c0a9 (patch) | |
tree | 4e8e788eb3bcd49bf6f908f66df9ea26220a0879 /src/ports/SkFontConfigInterface_direct.cpp | |
parent | a534b84237ae492e70078238f8a3f6fd0b162b79 (diff) | |
download | platform_external_skqp-750a24bb3d39e59d32db3f166ad3f39c7560c0a9.tar.gz platform_external_skqp-750a24bb3d39e59d32db3f166ad3f39c7560c0a9.tar.bz2 platform_external_skqp-750a24bb3d39e59d32db3f166ad3f39c7560c0a9.zip |
fix refcnts for singleton fontconfig-direct
git-svn-id: http://skia.googlecode.com/svn/trunk@8807 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports/SkFontConfigInterface_direct.cpp')
-rw-r--r-- | src/ports/SkFontConfigInterface_direct.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp index 1dcf932972..d4bb3e6819 100644 --- a/src/ports/SkFontConfigInterface_direct.cpp +++ b/src/ports/SkFontConfigInterface_direct.cpp @@ -41,7 +41,12 @@ private: SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() { static SkFontConfigInterface* gDirect; if (NULL == gDirect) { - gDirect = new SkFontConfigInterfaceDirect; + static SkMutex gMutex; + SkAutoMutexAcquire ac(gMutex); + + if (NULL == gDirect) { + gDirect = new SkFontConfigInterfaceDirect; + } } return gDirect; } |