Bug 1312623 - Don't attempt to shutdown a thread in the dtor of a GraphDriver, since it might be called during stable state. r=smaug
authorPaul Adenot <paul@paul.cx>
Tue, 04 Jul 2017 09:21:23 +0200
changeset 369190 bc861f3448315ffe829b3b800838ac8ed2b90a0b
parent 369143 8f7663ac2068ae33e99bb2ce637b98a9f9c283a2
child 369191 eb92b29f5500e747424882769b72d8d4770ae338
push id32193
push userkwierso@gmail.com
push dateTue, 18 Jul 2017 00:27:59 +0000
treeherdermozilla-central@5e73b9798464 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1312623
milestone56.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 1312623 - Don't attempt to shutdown a thread in the dtor of a GraphDriver, since it might be called during stable state. r=smaug MozReview-Commit-ID: HA67HQQrfow
dom/media/GraphDriver.cpp
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -158,23 +158,19 @@ public:
   }
 private:
   nsCOMPtr<nsIThread> mThread;
 };
 
 ThreadedDriver::~ThreadedDriver()
 {
   if (mThread) {
-    if (NS_IsMainThread()) {
-      mThread->Shutdown();
-    } else {
-      nsCOMPtr<nsIRunnable> event =
-        new MediaStreamGraphShutdownThreadRunnable(mThread.forget());
-      NS_DispatchToMainThread(event);
-    }
+    nsCOMPtr<nsIRunnable> event =
+      new MediaStreamGraphShutdownThreadRunnable(mThread.forget());
+    NS_DispatchToMainThread(event);
   }
 }
 class MediaStreamGraphInitThreadRunnable : public Runnable {
 public:
   explicit MediaStreamGraphInitThreadRunnable(ThreadedDriver* aDriver)
     : Runnable("MediaStreamGraphInitThreadRunnable")
     , mDriver(aDriver)
   {