bug 721315 - clear the faces' mFamily pointers when a font family is deleted. r=jdaggett

This commit is contained in:
Jonathan Kew 2012-02-02 11:24:22 +00:00
parent 72cdfcf8c3
commit dd425a16eb

View File

@ -512,7 +512,18 @@ public:
mIsBadUnderlineFamily(false)
{ }
virtual ~gfxFontFamily() { }
virtual ~gfxFontFamily() {
// clear Family pointers in our faces; the font entries might stay
// alive due to cached font objects, but they can no longer refer
// to their families.
PRUint32 i = mAvailableFonts.Length();
while (i) {
gfxFontEntry *fe = mAvailableFonts[--i];
if (fe) {
fe->SetFamily(nsnull);
}
}
}
const nsString& Name() { return mName; }