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

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
« no previous file with comments | « 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..aaa69421e6c88868414ed418bcca5c48b771aa47 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)
+#if ENABLE(ASSERT)
+ , m_didCallDispose(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_didCallDispose);
--s_instanceCount;
#if DEBUG_AUDIONODE_REFERENCES
--s_nodeCount[nodeType()];
@@ -109,6 +113,9 @@ void AudioNode::dispose()
m_isMarkedForDeletion = true;
#endif
context()->unmarkDirtyNode(*this);
+#if ENABLE(ASSERT)
+ m_didCallDispose = true;
+#endif
}
String AudioNode::nodeTypeName() const
« no previous file with comments | « Source/modules/webaudio/AudioNode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698