Bug 1332402 - Part 2: just complain if SingletonThread is still active at shutdown r=bwc
authorRandell Jesup <rjesup@jesup.org>
Thu, 19 Jan 2017 15:07:47 -0500
changeset 343512 c1e8aed2515ee9f3a6b5dc4b422e02948d212a60
parent 343511 94ed8555d2ee4e0eacc2bce1118eed6c8b9c1844
child 343513 65d7f3924ba67802a277113790e9be8da088ebc8
push id31381
push userkwierso@gmail.com
push dateFri, 17 Feb 2017 20:45:51 +0000
treeherdermozilla-central@f302def88fe5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1332402
milestone54.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 1332402 - Part 2: just complain if SingletonThread is still active at shutdown r=bwc MozReview-Commit-ID: B57cZnCuAdv
media/mtransport/nr_socket_prsock.cpp
--- a/media/mtransport/nr_socket_prsock.cpp
+++ b/media/mtransport/nr_socket_prsock.cpp
@@ -109,16 +109,17 @@ nrappkit copyright:
 #include "runnable_utils.h"
 #include "mozilla/SyncRunnable.h"
 #include "nsTArray.h"
 #include "mozilla/dom/TCPSocketBinding.h"
 #include "nsITCPSocketCallback.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsISocketFilter.h"
+#include "nsDebug.h"
 
 #ifdef XP_WIN
 #include "mozilla/WindowsVersion.h"
 #endif
 
 #if defined(MOZILLA_INTERNAL_API)
 // csi_platform.h deep in nrappkit defines LOG_INFO and LOG_WARNING
 #ifdef LOG_INFO
@@ -173,18 +174,19 @@ namespace mozilla {
 
 #if defined(MOZILLA_INTERNAL_API)
 class SingletonThreadHolder final
 {
 private:
   ~SingletonThreadHolder()
   {
     r_log(LOG_GENERIC,LOG_DEBUG,"Deleting SingletonThreadHolder");
-    MOZ_ASSERT(!mThread, "SingletonThreads should be Released and shut down before exit!");
     if (mThread) {
+      // Likely a connection is somehow being held in CC or GC
+      NS_WARNING("SingletonThreads should be Released and shut down before exit!");
       mThread->Shutdown();
       mThread = nullptr;
     }
   }
 
   DISALLOW_COPY_ASSIGN(SingletonThreadHolder);
 
 public:
@@ -246,17 +248,17 @@ private:
   nsCOMPtr<nsIThread> mParentThread;
   nsCOMPtr<nsIThread> mThread;
 };
 
 static StaticRefPtr<SingletonThreadHolder> sThread;
 
 static void ClearSingletonOnShutdown()
 {
-  ClearOnShutdown(&sThread);
+  ClearOnShutdown(&sThread, ShutdownPhase::ShutdownThreads);
 }
 #endif
 
 static nsIThread* GetIOThreadAndAddUse_s()
 {
   // Always runs on STS thread!
 #if defined(MOZILLA_INTERNAL_API)
   // We need to safely release this on shutdown to avoid leaks