Bug 1414318 - Turn off |StartWriter| in leak checking builds. r=mccr8
☠☠ backed out by e437203962cc ☠ ☠
authorEric Rahm <erahm@mozilla.com>
Fri, 03 Nov 2017 14:17:57 -0700
changeset 390019 83f0e033450d1dce9a9ce96b37b465ae50dacdb6
parent 390018 4350a326a49805c6138aabd0ed68136498bf97cd
child 390020 dffccd112b821970c76f6e3d004cb28f5526a30f
push id96985
push userryanvm@gmail.com
push dateSat, 04 Nov 2017 00:49:36 +0000
treeherdermozilla-inbound@83f0e033450d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1414318
milestone58.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 1414318 - Turn off |StartWriter| in leak checking builds. r=mccr8
toolkit/components/terminator/nsTerminator.cpp
--- a/toolkit/components/terminator/nsTerminator.cpp
+++ b/toolkit/components/terminator/nsTerminator.cpp
@@ -223,17 +223,18 @@ void RunWriter(void* arg)
   NS_SetCurrentThreadName("Shutdown Statistics Writer");
 
   MOZ_LSAN_INTENTIONALLY_LEAK_OBJECT(arg);
   // Shutdown will generally complete before we have a chance to
   // deallocate. This is not a leak.
 
   // Setup destinationPath and tmpFilePath
 
-  nsCString destinationPath(static_cast<char*>(arg));
+  nsCString destinationPath;
+  destinationPath.Adopt(static_cast<char*>(arg));
   nsAutoCString tmpFilePath;
   tmpFilePath.Append(destinationPath);
   tmpFilePath.AppendLiteral(".tmp");
 
   // Cleanup any file leftover from a previous run
   Unused << PR_Delete(tmpFilePath.get());
   Unused << PR_Delete(destinationPath.get());
 
@@ -356,22 +357,22 @@ nsTerminator::SelfInit()
 }
 
 // Actually launch these threads. This takes place at the first sign of shutdown.
 void
 nsTerminator::Start()
 {
   MOZ_ASSERT(!mInitialized);
   StartWatchdog();
-#if !defined(DEBUG)
-  // Only allow nsTerminator to write on non-debug builds so we don't get leak warnings on
-  // shutdown for intentional leaks (see bug 1242084). This will be enabled again by bug
-  // 1255484 when 1255478 lands.
+#if !defined(NS_FREE_PERMANENT_DATA)
+  // Only allow nsTerminator to write on non-leak-checked builds so we don't
+  // get leak warnings on shutdown for intentional leaks (see bug 1242084).
+  // This will be enabled again by bug 1255484 when 1255478 lands.
   StartWriter();
-#endif // !defined(DEBUG)
+#endif // !defined(NS_FREE_PERMANENT_DATA)
   mInitialized = true;
 }
 
 // Prepare, allocate and start the watchdog thread.
 // By design, it will never finish, nor be deallocated.
 void
 nsTerminator::StartWatchdog()
 {