This commit is contained in:
Karl Tomlinson 2008-09-19 15:03:27 +12:00
Родитель b27afa1e2e 1f7de7309d
Коммит f9f5f27cc6
1 изменённых файлов: 7 добавлений и 17 удалений

Просмотреть файл

@ -454,7 +454,10 @@ public:
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "gfxFont");
if (mRefCnt == 0) {
NotifyReleased();
// Don't delete just yet; return the object to the cache for
// possibly recycling within some time limit
gfxFontCache::GetCache()->NotifyReleased(this);
return 0;
}
return mRefCnt;
}
@ -464,21 +467,8 @@ public:
protected:
nsAutoRefCnt mRefCnt;
void NotifyReleased() {
gfxFontCache *cache = gfxFontCache::GetCache();
if (cache) {
// Don't delete just yet; return the object to the cache for
// possibly recycling within some time limit
cache->NotifyReleased(this);
} else {
// The cache may have already been shut down.
delete this;
}
}
gfxFont(gfxFontEntry *aFontEntry, const gfxFontStyle *aFontStyle);
public:
gfxFont(gfxFontEntry *aFontEntry, const gfxFontStyle *aFontStyle);
virtual ~gfxFont();
const nsString& GetName() const { return mFontEntry->Name(); }
@ -647,6 +637,7 @@ public:
protected:
nsRefPtr<gfxFontEntry> mFontEntry;
// The family name of the font
PRPackedBool mIsValid;
nsExpirationState mExpirationState;
gfxFontStyle mStyle;
@ -1489,10 +1480,9 @@ private:
};
class THEBES_API gfxFontGroup : public gfxTextRunFactory {
protected:
public:
gfxFontGroup(const nsAString& aFamilies, const gfxFontStyle *aStyle);
public:
virtual ~gfxFontGroup() {
mFonts.Clear();
}