summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/html
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-08-12 14:25:25 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-12 14:47:40 +0200
commit0a7e9ff70ff2e043d8c4d1c74732450899aa95db (patch)
tree158c5d631d82d24aeb03d0fd9a6fc73e3694730b /Source/WebCore/html
parent9f16f26dda5fc1cdff166fcadb598068e02147e5 (diff)
Resource leak related to gstreamer and videos
MERGE NOTE: Fixes a leak caused by a circular reference between GStreamer and WebKit, that triggers whenever a page with HTML5 video has been visited and it fully loaded. https://bugs.webkit.org/show_bug.cgi?id=109350 Reviewed by Eric Carlson. Since active DOM object are only stopped once and can not be restarted, we can unreference the media player there, instead of waiting for garbage collection. If the r152778 is rolled back, this also breaks a circular reference between GStreamer and WebKit which prevented garbage collecting from triggering. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::stop): Change-Id: Ie13d202d3cac9b97eb158964b33d492e17f817ef git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153937 268f45cc-cd09-0410-ab3c-d52691b4dbfc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebCore/html')
-rw-r--r--Source/WebCore/html/HTMLMediaElement.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index 3ef167106..d628548c5 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -3814,6 +3814,11 @@ void HTMLMediaElement::stop()
cancelPendingEventsAndCallbacks();
m_asyncEventQueue->close();
+
+ // Once an active DOM object has been stopped it can not be restarted, so we can deallocate
+ // the media player now. Note that userCancelledLoad will already have cleared the player
+ // if the media was not fully loaded. This handles all other cases.
+ m_player.clear();
}
void HTMLMediaElement::suspend(ReasonForSuspension why)