Commit a8caf1f2 authored by Jonathan Kew's avatar Jonathan Kew
Browse files

Bug 1824200 - Lock around access to mUnscaledFontCache. r=lsalzman, a=dsmith

parent 91279762
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -921,9 +921,14 @@ gfxFont* gfxFontconfigFontEntry::CreateFontInstance(
    file = ToCharPtr(fcFile);
  }

  RefPtr<UnscaledFontFontconfig> unscaledFont =
      mUnscaledFontCache.Lookup(file, index);
  RefPtr<UnscaledFontFontconfig> unscaledFont;
  {
    AutoReadLock lock(mLock);
    unscaledFont = mUnscaledFontCache.Lookup(file, index);
  }

  if (!unscaledFont) {
    AutoWriteLock lock(mLock);
    // Here, we use the original mFTFace, not a potential clone with variation
    // settings applied.
    auto ftFace = GetFTFace();