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

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 15959010: Fix scheduleEvent() crash. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 8b0714ad486667714457c3238a0a64a5e84ea562..e3039153f0ae2554e84de2cab1d0092c7162703a 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -243,6 +243,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* docum
, m_lastTextTrackUpdateTime(-1)
, m_textTracks(0)
, m_ignoreTrackDisplayUpdate(0)
+ , m_inDestructor(false)
#if ENABLE(WEB_AUDIO)
, m_audioSourceNode(0)
#endif
@@ -266,6 +267,8 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* docum
HTMLMediaElement::~HTMLMediaElement()
{
LOG(Media, "HTMLMediaElement::~HTMLMediaElement");
+ m_inDestructor = true;
+
setShouldDelayLoadEvent(false);
document()->unregisterForCaptionPreferencesChangedCallbacks(this);
if (m_textTracks)
@@ -519,6 +522,8 @@ void HTMLMediaElement::scheduleEvent(const AtomicString& eventName)
#if LOG_MEDIA_EVENTS
LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", eventName.string().ascii().data());
#endif
+ if (m_inDestructor)
+ return;
RefPtr<Event> event = Event::create(eventName, false, true);
event->setTarget(this);
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698