Bug 1432855 - Early-return if we're asked to clear the expired histogram. r=gfritzsche, a=lizzard
authorChris H-C <chutten@mozilla.com>
Wed, 24 Jan 2018 16:26:29 -0500
changeset 454575 db9269c469a7862a8b4bb31bd1b438a4d7c4e8d5
parent 454574 737f7d2ba61959aa33f38a581e2394c52e18054d
child 454576 87c23b241c1d6b94246a8f7492522cc307ea0f79
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche, lizzard
bugs1432855
milestone59.0
Bug 1432855 - Early-return if we're asked to clear the expired histogram. r=gfritzsche, a=lizzard MozReview-Commit-ID: IH4BCDq8fgz
toolkit/components/telemetry/TelemetryHistogram.cpp
--- a/toolkit/components/telemetry/TelemetryHistogram.cpp
+++ b/toolkit/components/telemetry/TelemetryHistogram.cpp
@@ -378,16 +378,20 @@ internal_GetHistogramIdByName(const nsAC
   return NS_OK;
 }
 
 // Clear a histogram from storage.
 void
 internal_ClearHistogramById(HistogramID histogramId, ProcessID processId, SessionType sessionType)
 {
   size_t index = internal_HistogramStorageIndex(histogramId, processId, sessionType);
+  if (gHistogramStorage[index] == gExpiredHistogram) {
+    // We keep gExpiredHistogram until TelemetryHistogram::DeInitializeGlobalState
+    return;
+  }
   delete gHistogramStorage[index];
   gHistogramStorage[index] = nullptr;
 }
 
 }
 
 ////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////