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 291462 12a8098d19453f001f7b8e54d8664a6e736ab450
parent 291461 5a71c82101e34728ccfacac3c52b3c68f117a0f6
child 291463 d4bf2f467ce9a65322367d6441b90594ff9d9d7b
push id5246
push usermozilla@noorenberghe.ca
push dateWed, 09 Sep 2015 21:17:14 +0000
reviewersroc, ritu
bugs1191889
milestone41.0
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
@@ -1974,16 +1974,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();
 }