Bug 1334105 - Work around startup crashes in Version(MOZ_APP_VERSION) checks. r=chutten a=gchang
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Wed, 08 Feb 2017 18:43:27 +0100
changeset 378362 71d115ba551cc5ae7a7fe77a178e30a9f4606468
parent 378361 a6a8ca19a0112bd6e4ab098e48ffc64a6c5a7229
child 378363 47533612715f695d8c9699ca5383bc1c3e44d198
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten, gchang
bugs1334105
milestone53.0a2
Bug 1334105 - Work around startup crashes in Version(MOZ_APP_VERSION) checks. r=chutten a=gchang
toolkit/components/telemetry/TelemetryCommon.cpp
--- a/toolkit/components/telemetry/TelemetryCommon.cpp
+++ b/toolkit/components/telemetry/TelemetryCommon.cpp
@@ -16,20 +16,21 @@
 
 namespace mozilla {
 namespace Telemetry {
 namespace Common {
 
 bool
 IsExpiredVersion(const char* aExpiration)
 {
-  static mozilla::Version current_version = mozilla::Version(MOZ_APP_VERSION);
   MOZ_ASSERT(aExpiration);
+  // Note: We intentionally don't construct a static Version object here as we
+  // saw odd crashes around this (see bug 1334105).
   return strcmp(aExpiration, "never") && strcmp(aExpiration, "default") &&
-    (mozilla::Version(aExpiration) <= current_version);
+    (mozilla::Version(aExpiration) <= MOZ_APP_VERSION);
 }
 
 bool
 IsInDataset(uint32_t aDataset, uint32_t aContainingDataset)
 {
   if (aDataset == aContainingDataset) {
     return true;
   }