Bug 1257211: Exit early if already shutting down. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 17 Mar 2016 12:58:21 +1100
changeset 312891 c03462e7761dc67d15c69d65d05ed658cdbe3243
parent 312890 5d560d039557beef1c9e145f2dc436c525d53ddf
child 312892 b61921a307e9ed7d94e94290dda4672ad2779bd0
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1257211
milestone48.0a1
Bug 1257211: Exit early if already shutting down. r=gerald MozReview-Commit-ID: 1Oi4m2AIByw
dom/media/Benchmark.cpp
--- a/dom/media/Benchmark.cpp
+++ b/dom/media/Benchmark.cpp
@@ -200,16 +200,20 @@ BenchmarkPlayback::InitDecoder(TrackInfo
     });
 }
 
 void
 BenchmarkPlayback::MainThreadShutdown()
 {
   MOZ_ASSERT(OnThread());
 
+  if (mFinished) {
+    // Nothing more to do.
+    return;
+  }
   mFinished = true;
 
   if (mDecoder) {
     mDecoder->Flush();
     mDecoder->Shutdown();
     mDecoder = nullptr;
   }