bug 1002325 - don't try to rebuild rules if the font set is being deleted. r=jdaggett
authorJonathan Kew <jkew@mozilla.com>
Thu, 01 May 2014 08:54:11 +0100
changeset 181551 293ecda82136f86fb5605aeea6b3df2eccec3775
parent 181550 7118f282f343f7390d1dce0f9c0a0b3bb8274b7f
child 181552 de07501e90b580503b0af6e67c0daca62a7c4dc2
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersjdaggett
bugs1002325
milestone32.0a1
bug 1002325 - don't try to rebuild rules if the font set is being deleted. r=jdaggett
layout/style/nsFontFaceLoader.cpp
--- a/layout/style/nsFontFaceLoader.cpp
+++ b/layout/style/nsFontFaceLoader.cpp
@@ -1009,10 +1009,17 @@ nsUserFontSet::GetPrivateBrowsing()
 
   nsCOMPtr<nsILoadContext> loadContext = ps->GetDocument()->GetLoadContext();
   return loadContext && loadContext->UsePrivateBrowsing();
 }
 
 void
 nsUserFontSet::DoRebuildUserFontSet()
 {
+  if (!mPresContext) {
+    // AFAICS, this can only happen if someone has already called Destroy() on
+    // this font-set, which means it is in the process of being torn down --
+    // so there's no point trying to update its rules.
+    return;
+  }
+
   mPresContext->RebuildUserFontSet();
 }