RESOLVED FIXED106394
If ImageLoader's loadEventSender or errorEventSender fires after document is detached, the document will be leaked.
https://bugs.webkit.org/show_bug.cgi?id=106394
Summary If ImageLoader's loadEventSender or errorEventSender fires after document is ...
Yongjun Zhang
Reported 2013-01-08 16:11:32 PST
If load the following HTML into OS X Safari and use heap to count the number of HTMLDocuments, you will see the number keeps growing, which indicates HTMLDocuments are not released. <html> <script type="text/javascript"> window.addEventListener('DOMContentLoaded', function () { setTimeout(function() {location.reload();}, 100); for (var k=0; k<2000; k++) { setTimeout(function () { for (var i=0; i<20; i++) { var bubble = document.createElement('img'); bubble.src = "http://www.myfakeserver.com/fake_image.png"; document.getElementById('map_439582365').appendChild(bubble); } }, k*25/10); } }, false); </script> <div id="map_439582365"> </div> </body></html>
Attachments
Also deref the element in dispatchPendingLoadEvent and dispatchPendingErrorEvent if the document was detached. (2.76 KB, patch)
2013-01-08 17:22 PST, Yongjun Zhang
no flags
Yongjun Zhang
Comment 1 2013-01-08 16:13:53 PST
Yongjun Zhang
Comment 2 2013-01-08 17:22:54 PST
Created attachment 181811 [details] Also deref the element in dispatchPendingLoadEvent and dispatchPendingErrorEvent if the document was detached.
Alexey Proskuryakov
Comment 3 2013-01-09 10:05:32 PST
Comment on attachment 181811 [details] Also deref the element in dispatchPendingLoadEvent and dispatchPendingErrorEvent if the document was detached. Great catch!
David Kilzer (:ddkilzer)
Comment 4 2013-01-09 10:07:07 PST
Yongjun Zhang
Comment 5 2013-01-09 10:33:31 PST
Comment on attachment 181811 [details] Also deref the element in dispatchPendingLoadEvent and dispatchPendingErrorEvent if the document was detached. thanks ap!
WebKit Review Bot
Comment 6 2013-01-09 10:53:34 PST
Comment on attachment 181811 [details] Also deref the element in dispatchPendingLoadEvent and dispatchPendingErrorEvent if the document was detached. Clearing flags on attachment: 181811 Committed r139209: <http://trac.webkit.org/changeset/139209>
WebKit Review Bot
Comment 7 2013-01-09 10:53:38 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.