summaryrefslogtreecommitdiffstats
path: root/gfx/thebes/gfxFT2FontList.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-12-12 00:18:43 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-12-12 00:18:43 +0100
commit67d5558f1a1b5b26a771c3a05e1e63a2966cc325 (patch)
tree38334d669039e44770881413c40a0801494de547 /gfx/thebes/gfxFT2FontList.cpp
parent4f7e431137caffc0c1cc8deee361893a7eabe70c (diff)
downloadUXP-67d5558f1a1b5b26a771c3a05e1e63a2966cc325.tar
UXP-67d5558f1a1b5b26a771c3a05e1e63a2966cc325.tar.gz
UXP-67d5558f1a1b5b26a771c3a05e1e63a2966cc325.tar.lz
UXP-67d5558f1a1b5b26a771c3a05e1e63a2966cc325.tar.xz
UXP-67d5558f1a1b5b26a771c3a05e1e63a2966cc325.zip
Clear weak pointers in FT2 font list shutdown observers.
Diffstat (limited to 'gfx/thebes/gfxFT2FontList.cpp')
-rw-r--r--gfx/thebes/gfxFT2FontList.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/gfx/thebes/gfxFT2FontList.cpp b/gfx/thebes/gfxFT2FontList.cpp
index 8a652df0d..09c938a24 100644
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -812,6 +812,15 @@ public:
: mFontList(aFontList)
{ }
+ void Remove()
+ {
+ nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
+ if (obs) {
+ obs->RemoveObserver(this, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID);
+ }
+ mFontList = nullptr;
+ }
+
protected:
virtual ~WillShutdownObserver()
{ }
@@ -847,11 +856,7 @@ gfxFT2FontList::gfxFT2FontList()
gfxFT2FontList::~gfxFT2FontList()
{
if (mObserver) {
- nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
- if (obs) {
- obs->RemoveObserver(mObserver, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID);
- }
- mObserver = nullptr;
+ mObserver->Remove();
}
}