Bug 1257211: Exit early if already shutting down. r?gerald draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 17 Mar 2016 12:58:21 +1100
changeset 341452 a7bd8e60df762e61f0224b61c412c37ef1648423
parent 341451 5cfc10c14aaea2a449f74dcbb366179a45442dd6
child 341494 1345b3fe9ad520c94b7e3788cceb38f83ef2c828
push id13213
push userbmo:jyavenard@mozilla.com
push dateThu, 17 Mar 2016 01:58:55 +0000
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;
   }