Bug 866108 - Part 1: Don't attempt to dispatch the audioprocess event on a node which has been unlinked by the cycle collector; r=padenot
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 27 Apr 2013 15:04:10 -0400
changeset 130203 bad7e68276958bbf74b27b91bc7b3e8f8dba41ec
parent 130202 af02393720f01cd3a12741a5b4825b4a1927f6d2
child 130204 217a16890daafb05cefac60399acb139806c18fa
push idunknown
push userunknown
push dateunknown
reviewerspadenot
bugs866108
milestone23.0a1
Bug 866108 - Part 1: Don't attempt to dispatch the audioprocess event on a node which has been unlinked by the cycle collector; r=padenot
content/media/webaudio/ScriptProcessorNode.cpp
--- a/content/media/webaudio/ScriptProcessorNode.cpp
+++ b/content/media/webaudio/ScriptProcessorNode.cpp
@@ -281,17 +281,17 @@ private:
         {
           // No need to keep holding the lock for the whole duration of this
           // function, since we're holding a strong reference to it, so if
           // we can obtain the reference, we will hold the node alive in
           // this function.
           MutexAutoLock lock(mStream->Engine()->NodeMutex());
           node = static_cast<ScriptProcessorNode*>(mStream->Engine()->Node());
         }
-        if (!node) {
+        if (!node || !node->Context()) {
           return NS_OK;
         }
 
         AutoPushJSContext cx(node->Context()->GetJSContext());
         if (cx) {
           JSAutoRequest ar(cx);
 
           // Create the input buffer