Index: Source/core/html/HTMLMediaElement.cpp |
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp |
index 21942520fe4aeb31033a9899b054d37660d7f3c3..34014322d49057249becb2fdea2134c6d50a601d 100644 |
--- a/Source/core/html/HTMLMediaElement.cpp |
+++ b/Source/core/html/HTMLMediaElement.cpp |
@@ -1316,14 +1316,20 @@ void HTMLMediaElement::textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue> c |
CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, cue.get()); |
m_cueTree.remove(interval); |
+ // Since the cue will be removed from the media element and likely the |
+ // TextTrack might also be destructed, notifying the region of the cue |
+ // removal shouldn't be done. |
+ cue->notifyRegionWhenRemovingDisplayTree(false); |
+ |
size_t index = m_currentlyActiveCues.find(interval); |
if (index != kNotFound) { |
m_currentlyActiveCues.remove(index); |
cue->setIsActive(false); |
} |
- |
cue->removeDisplayTree(); |
updateActiveTextTrackCues(currentTime()); |
+ |
+ cue->notifyRegionWhenRemovingDisplayTree(true); |
} |