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

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

Issue 455353002: Add an ASSERT to verify that AudioNode::dispose() is always called (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« Source/modules/webaudio/AudioNode.h ('K') | « Source/modules/webaudio/AudioNode.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioNode.cpp
diff --git a/Source/modules/webaudio/AudioNode.cpp b/Source/modules/webaudio/AudioNode.cpp
index 4c0c9d51ca4c780061835b9279146c08476825b0..0e6ee07acef056c2bfd8e0d0ffc6046fcfc2039f 100644
--- a/Source/modules/webaudio/AudioNode.cpp
+++ b/Source/modules/webaudio/AudioNode.cpp
@@ -58,6 +58,9 @@ AudioNode::AudioNode(AudioContext* context, float sampleRate)
, m_connectionRefCount(0)
, m_isMarkedForDeletion(false)
, m_isDisabled(false)
+#ifndef NDEBUG
tkent 2014/08/11 10:13:06 #if ENABLE(ASSERT)
haraken 2014/08/11 10:32:59 Done.
+ , m_disposeIsCalled(false)
+#endif
, m_channelCount(2)
, m_channelCountMode(Max)
, m_channelInterpretation(AudioBus::Speakers)
@@ -77,6 +80,7 @@ AudioNode::AudioNode(AudioContext* context, float sampleRate)
AudioNode::~AudioNode()
{
+ ASSERT(m_disposeIsCalled);
--s_instanceCount;
#if DEBUG_AUDIONODE_REFERENCES
--s_nodeCount[nodeType()];
@@ -109,6 +113,9 @@ void AudioNode::dispose()
m_isMarkedForDeletion = true;
#endif
context()->unmarkDirtyNode(*this);
+#ifndef NDEBUG
tkent 2014/08/11 10:13:06 Ditto.
+ m_disposeIsCalled = true;
+#endif
}
String AudioNode::nodeTypeName() const
« Source/modules/webaudio/AudioNode.h ('K') | « Source/modules/webaudio/AudioNode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698