Index: src/ports/SkFontConfigInterface_direct.cpp |
diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp |
index dc9afbae1f47b642704ca02df68923145f38898f..c0cfd8fdcf9cd9c43ab565cb15e76d58badb9b6b 100644 |
--- a/src/ports/SkFontConfigInterface_direct.cpp |
+++ b/src/ports/SkFontConfigInterface_direct.cpp |
@@ -124,9 +124,13 @@ private: |
SkMutex mutex_; |
}; |
-SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() { |
- SK_DECLARE_STATIC_LAZY_PTR(SkFontConfigInterfaceDirect, direct); |
- return direct.get(); |
+SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface(SkBaseMutex* mutex) { |
+ SkAutoMutexAcquire ac(mutex); |
+ static SkFontConfigInterfaceDirect* singleton = NULL; |
+ if (singleton == NULL) { |
+ singleton = SkNEW(SkFontConfigInterfaceDirect); |
+ } |
+ return singleton; |
} |
/////////////////////////////////////////////////////////////////////////////// |