Bug 1257211: Exit early if already shutting down. r=gerald a=ritu
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 17 Mar 2016 12:58:21 +1100
changeset 325633 9985cfb9f7aee2fecbe79273afab51649435e8b8
parent 325632 d549d9ad9c14611fb7c33acb691194e873d7b805
child 325634 9f8275d6c8221609174c85dbef649dda82dc9272
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, ritu
bugs1257211
milestone47.0a2
Bug 1257211: Exit early if already shutting down. r=gerald a=ritu MozReview-Commit-ID: 1Oi4m2AIByw
dom/media/Benchmark.cpp
--- a/dom/media/Benchmark.cpp
+++ b/dom/media/Benchmark.cpp
@@ -209,16 +209,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;
   }