bug 655138 - don't use font entry after it's been replaced. r=jdaggett

This commit is contained in:
Jonathan Kew 2011-05-08 13:09:03 +01:00
parent db143937fe
commit 172cf715bc

View File

@ -103,8 +103,10 @@ public:
for (PRUint32 i = 0; i < numFonts; i++) {
gfxFontEntry *fe = mAvailableFonts[i];
if (fe == aOldFontEntry) {
mAvailableFonts[i] = aNewFontEntry;
aOldFontEntry->SetFamily(nsnull);
// note that this may delete aOldFontEntry, if there's no
// other reference to it except from its family
mAvailableFonts[i] = aNewFontEntry;
aNewFontEntry->SetFamily(this);
return;
}