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;
}
return fci;
}
fci = SkFontConfigInterface::GetSingletonDirectInterface();
- SkFontConfigInterface::SetGlobal(fci)->unref();
+ SkFontConfigInterface::SetGlobal(fci);
}
}