Index: third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp |
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp |
index 2e72ec0778d2f4d10bedb4b47c8f0f8f00d29de2..0914dfafd913d50de7e1151223037dc794d762e9 100644 |
--- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp |
+++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp |
@@ -213,8 +213,10 @@ void BaseAudioContext::stop() |
bool BaseAudioContext::hasPendingActivity() const |
{ |
- // There's no pending activity if the audio context has been cleared. |
- return !m_isCleared; |
+ // If the destination node (handler) has any active connection and the audio |
+ // graph needs to be rendered, we mark the context as 'hasPendingActivity'. |
+ // This keeps this node from getting GCed. |
+ return destination()->hasConnection(); |
} |
AudioDestinationNode* BaseAudioContext::destination() const |