mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
b=454735 Make gfxFont more tolerant to shutdown of the gfxFontCache r=roc
This commit is contained in:
parent
cc1a3203b5
commit
fb0d6fc718
@ -454,9 +454,8 @@ public:
|
||||
--mRefCnt;
|
||||
NS_LOG_RELEASE(this, mRefCnt, "gfxFont");
|
||||
if (mRefCnt == 0) {
|
||||
// Don't delete just yet; return the object to the cache for
|
||||
// possibly recycling within some time limit
|
||||
gfxFontCache::GetCache()->NotifyReleased(this);
|
||||
NotifyReleased();
|
||||
// |this| may have been deleted.
|
||||
return 0;
|
||||
}
|
||||
return mRefCnt;
|
||||
@ -467,8 +466,21 @@ public:
|
||||
protected:
|
||||
nsAutoRefCnt mRefCnt;
|
||||
|
||||
public:
|
||||
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:
|
||||
virtual ~gfxFont();
|
||||
|
||||
const nsString& GetName() const { return mFontEntry->Name(); }
|
||||
@ -637,7 +649,6 @@ public:
|
||||
protected:
|
||||
nsRefPtr<gfxFontEntry> mFontEntry;
|
||||
|
||||
// The family name of the font
|
||||
PRPackedBool mIsValid;
|
||||
nsExpirationState mExpirationState;
|
||||
gfxFontStyle mStyle;
|
||||
@ -1480,9 +1491,10 @@ private:
|
||||
};
|
||||
|
||||
class THEBES_API gfxFontGroup : public gfxTextRunFactory {
|
||||
public:
|
||||
protected:
|
||||
gfxFontGroup(const nsAString& aFamilies, const gfxFontStyle *aStyle);
|
||||
|
||||
public:
|
||||
virtual ~gfxFontGroup() {
|
||||
mFonts.Clear();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user