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

Unified Diff: Source/modules/webaudio/AudioNode.cpp

Issue 802593004: WebAudio: Fix AudioNode leak in a case that AudioNode is not disconnected from the graph explicitly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 10 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: Source/modules/webaudio/AudioNode.cpp
diff --git a/Source/modules/webaudio/AudioNode.cpp b/Source/modules/webaudio/AudioNode.cpp
index 6733a0df59ec9fa6952b5a9ddf756c5e3784fccc..f640cd4da5afd67746b41cd117b3675ce74c6f45 100644
--- a/Source/modules/webaudio/AudioNode.cpp
+++ b/Source/modules/webaudio/AudioNode.cpp
@@ -105,6 +105,11 @@ void AudioNode::dispose()
context()->disposeOutputs(*this);
for (unsigned i = 0; i < m_outputs.size(); ++i)
output(i)->disconnectAll();
+
+ if (context()->contextState() != AudioContext::Running)
+ return;
+ ThreadState::current()->markAsZombie(this);
+ context()->setLastZombie(this);
}
String AudioNode::nodeTypeName() const

Powered by Google App Engine
This is Rietveld 408576698