Bug 1401427 - Fix leak in the UACacheReporter and re-enable it. r=heycam.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 20 Sep 2017 21:17:27 +1000
changeset 381872 8658f8f875d1d3015de7cdc495edea872436403f
parent 381871 d5e1533786ee8a8f754ef737ccd7980d30818e93
child 381873 b95045e6223be4ef08d60b34577f48be87c95aab
push id95217
push usernnethercote@mozilla.com
push dateWed, 20 Sep 2017 12:12:01 +0000
treeherdermozilla-inbound@8658f8f875d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1401427
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 1401427 - Fix leak in the UACacheReporter and re-enable it. r=heycam. The problem was the missing |gUACacheReporter = nullptr;|.
layout/style/ServoBindings.cpp
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -2437,43 +2437,41 @@ Gecko_XBLBinding_GetRawServoStyleSet(Raw
 }
 
 bool
 Gecko_XBLBinding_InheritsStyle(RawGeckoXBLBindingBorrowed aXBLBinding)
 {
   return aXBLBinding->InheritsStyle();
 }
 
-// XXX: temporarily disabled due to a leak, see bug 1401427
-//static StaticRefPtr<UACacheReporter> gUACacheReporter;
+static StaticRefPtr<UACacheReporter> gUACacheReporter;
 
 void
 InitializeServo()
 {
   URLExtraData::InitDummy();
   Servo_Initialize(URLExtraData::Dummy());
 
-  // XXX: temporarily disabled due to a leak, see bug 1401427
-  //gUACacheReporter = new UACacheReporter();
-  //RegisterWeakMemoryReporter(gUACacheReporter);
+  gUACacheReporter = new UACacheReporter();
+  RegisterWeakMemoryReporter(gUACacheReporter);
 
   sServoFontMetricsLock = new Mutex("Gecko_GetFontMetrics");
   sServoWidgetLock = new Mutex("Servo::WidgetLock");
   sServoLangFontPrefsLock = new RWLock("nsPresContext::GetDefaultFont");
 }
 
 void
 ShutdownServo()
 {
   MOZ_ASSERT(sServoFontMetricsLock);
   MOZ_ASSERT(sServoWidgetLock);
   MOZ_ASSERT(sServoLangFontPrefsLock);
 
-  // XXX: temporarily disabled due to a leak, see bug 1401427
-  //UnregisterWeakMemoryReporter(gUACacheReporter);
+  UnregisterWeakMemoryReporter(gUACacheReporter);
+  gUACacheReporter = nullptr;
 
   delete sServoFontMetricsLock;
   delete sServoWidgetLock;
   delete sServoLangFontPrefsLock;
   Servo_Shutdown();
 }
 
 namespace mozilla {