Bug 1191889 - Skip Close() when not initialized. r=roc, a=ritu
authorKarl Tomlinson <karlt+@karlt.net>
Mon, 17 Aug 2015 10:07:50 +1200
changeset 288794 be5138e9b8492bda169657044c1116743d3bb1f0
parent 288793 71d74dcbafd703dbd816314f2338be6c6c08c50f
child 288795 4345fbf90ea4af6cd2b6a9158d6a190dea425576
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, ritu
bugs1191889
milestone42.0a2
Bug 1191889 - Skip Close() when not initialized. r=roc, a=ritu
dom/media/MediaCache.cpp
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -1979,16 +1979,19 @@ MediaCacheStream::AreAllStreamsForResour
   return true;
 }
 
 void
 MediaCacheStream::Close()
 {
   NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
 
+  if (!mInitialized)
+    return;
+
   ReentrantMonitorAutoEnter mon(gMediaCache->GetReentrantMonitor());
   CloseInternal(mon);
   // Queue an Update since we may have created more free space. Don't do
   // it from CloseInternal since that gets called by Update() itself
   // sometimes, and we try to not to queue updates from Update().
   gMediaCache->QueueUpdate();
 }