Bug 917260 - Null check mDestination in AudioContext::Shutdown(). r=ehsan, a=akeybl
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 19 Sep 2013 12:04:13 +1200
changeset 154101 859717cd6229961e63567854f0d03113e6058917
parent 154100 902feb79b47748befcc3d7bdbd579632fb17ae68
child 154102 e0863bd262a9fb7d33599c4b704571419cdad15d
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewersehsan, akeybl
bugs917260
milestone25.0
Bug 917260 - Null check mDestination in AudioContext::Shutdown(). r=ehsan, a=akeybl This handles the case where Shutdown() is called after Unlink() (but before the destructor).
content/media/webaudio/AudioContext.cpp
--- a/content/media/webaudio/AudioContext.cpp
+++ b/content/media/webaudio/AudioContext.cpp
@@ -572,17 +572,17 @@ AudioContext::Shutdown()
   // their self-references.
   nsTArray<ScriptProcessorNode*> spNodes;
   GetHashtableElements(mScriptProcessorNodes, spNodes);
   for (uint32_t i = 0; i < spNodes.Length(); ++i) {
     spNodes[i]->Stop();
   }
 
   // For offline contexts, we can destroy the MediaStreamGraph at this point.
-  if (mIsOffline) {
+  if (mIsOffline && mDestination) {
     mDestination->OfflineShutdown();
   }
 }
 
 void
 AudioContext::Suspend()
 {
   MediaStream* ds = DestinationStream();