Fix deadlock in Android's font deserializer.
authordjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 30 Mar 2012 12:42:12 +0000 (12:42 +0000)
committerdjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 30 Mar 2012 12:42:12 +0000 (12:42 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@3551 2bbb7eff-a529-9590-31e7-b0007b416f81

src/ports/SkFontHost_android.cpp

index edbc0169af939781a4c0bfb426d8981a5f7e2c7f..230e990096ab3184ed8de57c911d902bc9d73b2a 100644 (file)
@@ -745,9 +745,10 @@ void SkFontHost::Serialize(const SkTypeface* face, SkWStream* stream) {
 }
 
 SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
-    SkAutoMutexAcquire  ac(gFamilyHeadAndNameListMutex);
-
-    load_system_fonts();
+    {
+        SkAutoMutexAcquire  ac(gFamilyHeadAndNameListMutex);
+        load_system_fonts();
+    }
 
     // check if the font is a custom or system font
     bool isCustomFont = stream->readBool();