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

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: New marking mode, simpify WebAudio code 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 02a19bdd1acb4254d31b3dc5fa63f3a8cb1852c2..7ce68809c952c1cef15ffcc17ca4a587703021fa 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