mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-27 17:47:34 +09:00
Clear weak pointers in FT2 font list shutdown observers.
This commit is contained in:
parent
bb5e286644
commit
f3de54e835
2 changed files with 12 additions and 6 deletions
|
|
@ -812,6 +812,15 @@ public:
|
||||||
: mFontList(aFontList)
|
: mFontList(aFontList)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
void Remove()
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||||
|
if (obs) {
|
||||||
|
obs->RemoveObserver(this, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID);
|
||||||
|
}
|
||||||
|
mFontList = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~WillShutdownObserver()
|
virtual ~WillShutdownObserver()
|
||||||
{ }
|
{ }
|
||||||
|
|
@ -847,11 +856,7 @@ gfxFT2FontList::gfxFT2FontList()
|
||||||
gfxFT2FontList::~gfxFT2FontList()
|
gfxFT2FontList::~gfxFT2FontList()
|
||||||
{
|
{
|
||||||
if (mObserver) {
|
if (mObserver) {
|
||||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
mObserver->Remove();
|
||||||
if (obs) {
|
|
||||||
obs->RemoveObserver(mObserver, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID);
|
|
||||||
}
|
|
||||||
mObserver = nullptr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ using mozilla::dom::FontListEntry;
|
||||||
class FontNameCache;
|
class FontNameCache;
|
||||||
typedef struct FT_FaceRec_* FT_Face;
|
typedef struct FT_FaceRec_* FT_Face;
|
||||||
class nsZipArchive;
|
class nsZipArchive;
|
||||||
|
class WillShutdownObserver;
|
||||||
|
|
||||||
class FT2FontEntry : public gfxFontEntry
|
class FT2FontEntry : public gfxFontEntry
|
||||||
{
|
{
|
||||||
|
|
@ -194,7 +195,7 @@ private:
|
||||||
|
|
||||||
mozilla::UniquePtr<FontNameCache> mFontNameCache;
|
mozilla::UniquePtr<FontNameCache> mFontNameCache;
|
||||||
int64_t mJarModifiedTime;
|
int64_t mJarModifiedTime;
|
||||||
nsCOMPtr<nsIObserver> mObserver;
|
RefPtr<WillShutdownObserver> mObserver;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* GFX_FT2FONTLIST_H */
|
#endif /* GFX_FT2FONTLIST_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue