Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp

Issue 2283053002: Fix BaseAudioContext::hasPendingActivity() to make it GCed correctly (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698