Bug 1396453 - (speculative fix) - Remove the registered-fonts-changed notification observer when shutting down Mac font list, to avoid any risk of being called later during shutdown. r=jrmuizel
authorJonathan Kew <jkew@mozilla.com>
Tue, 05 Sep 2017 20:45:26 +0100
changeset 379122 264087371af5dcbd4c0221ce716f3e01ce66ea9c
parent 379121 dadf26985c95d88cb187a26ec619a4898089a0c4
child 379123 d0bd5ff0d46f999b41fe8eff351d36c042a54a6f
push id32449
push userarchaeopteryx@coole-files.de
push dateWed, 06 Sep 2017 09:33:20 +0000
treeherdermozilla-central@c959327c6b75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1396453
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1396453 - (speculative fix) - Remove the registered-fonts-changed notification observer when shutting down Mac font list, to avoid any risk of being called later during shutdown. r=jrmuizel
gfx/thebes/gfxMacPlatformFontList.mm
--- a/gfx/thebes/gfxMacPlatformFontList.mm
+++ b/gfx/thebes/gfxMacPlatformFontList.mm
@@ -752,16 +752,21 @@ gfxMacPlatformFontList::gfxMacPlatformFo
 
     // cache this in a static variable so that MacOSFontFamily objects
     // don't have to repeatedly look it up
     sFontManager = [NSFontManager sharedFontManager];
 }
 
 gfxMacPlatformFontList::~gfxMacPlatformFontList()
 {
+    ::CFNotificationCenterRemoveObserver(::CFNotificationCenterGetLocalCenter(),
+                                         this,
+                                         kCTFontManagerRegisteredFontsChangedNotification,
+                                         0);
+
     if (mDefaultFont) {
         ::CFRelease(mDefaultFont);
     }
 }
 
 void
 gfxMacPlatformFontList::AddFamily(const nsAString& aFamilyName,
                                   bool aSystemFont)