Index: Source/core/html/HTMLMediaElement.cpp |
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp |
index af3e44e4494d0448e89dc1b8aefb4295c0965312..f8a7bc6f15f0886d6b044e344b0972e863558a18 100644 |
--- a/Source/core/html/HTMLMediaElement.cpp |
+++ b/Source/core/html/HTMLMediaElement.cpp |
@@ -303,8 +303,6 @@ HTMLMediaElement::~HTMLMediaElement() |
{ |
WTF_LOG(Media, "HTMLMediaElement::~HTMLMediaElement"); |
- m_asyncEventQueue->close(); |
- |
#if ENABLE(OILPAN) |
// If the HTMLMediaElement dies with the document we are not |
// allowed to touch the document to adjust delay load event counts |
@@ -319,10 +317,13 @@ HTMLMediaElement::~HTMLMediaElement() |
if (ActiveDOMObject::executionContext()) |
setShouldDelayLoadEvent(false); |
#else |
+ // HTMLMediaElement and m_asyncEventQueue always become unreachable |
+ // together. So HTMLMediaElemenet and m_asyncEventQueue are destructed in |
+ // the same GC. We don't need to close it explicitly in Oilpan. |
+ m_asyncEventQueue->close(); |
+ |
setShouldDelayLoadEvent(false); |
-#endif |
-#if !ENABLE(OILPAN) |
if (m_textTracks) |
m_textTracks->clearOwner(); |
@@ -3651,6 +3652,7 @@ void HTMLMediaElement::defaultEventHandler(Event* event) |
void HTMLMediaElement::trace(Visitor* visitor) |
{ |
+ visitor->trace(m_asyncEventQueue); |
visitor->trace(m_error); |
visitor->trace(m_currentSourceNode); |
visitor->trace(m_nextChildNodeToConsider); |