Bug 1513542 - We need to use gAllURLsMutex before destructor of a static variable. r=valentin
authorDragana Damjanovic <dd.mozilla@gmail.com>
Thu, 17 Jan 2019 16:29:04 +0000
changeset 514325 e54c8660c4472a25e36d1433ee4bf0e597bf707e
parent 514324 33247481200e0d9b4ddddaf9ce99e4a86b50c854
child 514326 69d656df4a8e626ea184db1573861b56ccd17671
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1513542
milestone66.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 1513542 - We need to use gAllURLsMutex before destructor of a static variable. r=valentin Differential Revision: https://phabricator.services.mozilla.com/D16847
netwerk/base/nsStandardURL.cpp
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -281,16 +281,17 @@ void nsStandardURL::ShutdownGlobalObject
   MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread());
   NS_IF_RELEASE(gIDN);
 
 #ifdef DEBUG_DUMP_URLS_AT_SHUTDOWN
   if (gInitialized) {
     // This instanciates a dummy class, and will trigger the class
     // destructor when libxul is unloaded. This is equivalent to atexit(),
     // but gracefully handles dlclose().
+    StaticMutexAutoLock lock(gAllURLsMutex);
     static DumpLeakedURLs d;
   }
 #endif
 }
 
 //----------------------------------------------------------------------------
 // nsStandardURL <private>
 //----------------------------------------------------------------------------