Bug Tracker

Opened 12 years ago

Closed 9 years ago

#2483 closed bug (worksforme)

jquery dom element construction within frame causing elements to leak

Reported by: sestizac Owned by:
Priority: major Milestone:
Component: core Version: 1.2.3
Keywords: leak, leaks, div<div>, frames, framesets Cc:
Blocked by: Blocking:

Description

jQuery Version: 1.2.3 Internet Explorer Version: 6 or 7

In the following example sIEve will report two leaks for every time leak() is called only when the page is inside a frame. If this html is served itself as the main page it will not report a leak BUT if it's served inside the below frameset these two leaks are reported each time the leak() function is called: <div>div<div></div></div>

It does not have anything to do with the append function as the noleak function (which doens't leak) also uses append. It happens anytime you create dom objects using $("..."). In my project we are dynamically creating a large table and each node in the table is reported as leaking when leaving the page. If I remove the frameset these nodes do not leak.

<frameset rows="*" framespacing="0" border="false" frameborder="0">

<frame src="frame.htm" frameborder="0">

</frameset>

<!-- frame.htm source --> <html>

<script language="javascript" src="jquery-1.2.3.min.js"></script> <script>

$(document).ready(function(){ });

function leak(){

$("#mydiv").append(":leak ");

}

function noleak(){

var text = document.createTextNode(':noleak '); $("#mydiv").append(text);

}

</script> <body >

<div id="mydiv">should be appended here</div><br/> <a href="#" onclick="leak();">leak</a><br/> <a href="#" onclick="noleak();">noleak</a><br/>

</body>

</html>

Change History (1)

comment:1 Changed 9 years ago by dmethvin

Resolution: worksforme
Status: newclosed

I don't see an increase in memory with 1.4.2 and IE8 so I'll close this ticket.

Note: See TracTickets for help on using tickets.