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

Unified Diff: Source/WebCore/webaudio/AudioContext.cpp

Issue 7947001: Merge 94608 - MediaElementAudioSourceNode destruction triggers ASSERTS (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 3 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/WebCore/webaudio/AudioContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/webaudio/AudioContext.cpp
===================================================================
--- Source/WebCore/webaudio/AudioContext.cpp (revision 95418)
+++ Source/WebCore/webaudio/AudioContext.cpp (working copy)
@@ -257,10 +257,25 @@
return m_hrtfDatabaseLoader->isLoaded();
}
+void AudioContext::uninitializeDispatch(void* userData)
+{
+ AudioContext* context = reinterpret_cast<AudioContext*>(userData);
+ ASSERT(context);
+ if (!context)
+ return;
+
+ context->uninitialize();
+}
+
void AudioContext::stop()
{
m_document = 0; // document is going away
- uninitialize();
+
+ // Don't call uninitialize() immediately here because the ScriptExecutionContext is in the middle
+ // of dealing with all of its ActiveDOMObjects at this point. uninitialize() can de-reference other
+ // ActiveDOMObjects so let's schedule uninitialize() to be called later.
+ // FIXME: see if there's a more direct way to handle this issue.
+ callOnMainThread(uninitializeDispatch, this);
}
Document* AudioContext::document() const
« no previous file with comments | « Source/WebCore/webaudio/AudioContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698