>> http://laurens.vd.oever.nl/weblog/items2005/closures/
>> 
>> Has this been found to be an adequate solution to this issue? 
>> (mainly for non jquery code)

> Yes, it solves the IE closure problem very nicely. My closure 
> plugin for jQuery uses a modified version of this code.

Yipes! I just did a quick test with IE6 and SVN 170. With nothing other than
the jQuery.js include and an empty body, it's leaking about 300KB for each
reload measured by Task Manager. FF doesn't leak at all. Can anyone else
repro that?

I think we discussed this topic a few months back, IE will leak memory if
any DOM elements have references to Javascript objects when the page
unloads. The jQuery event code adds a level of indirection to take care of
closures inside user-supplied event handlers, but it doesn't seem to remove
its own event handler or the Javascript objects it's attached to the DOM
object. That can be done with an onunload handler.

Here's my entire test file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<style type="text/css">
</style>

<script language="JavaScript" src="jquery-svn.js"
type="text/javascript"></script>

<script type="text/javascript">
</script>

</head>
<body>

</body>
</html>


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to