signal connect function leaks memory in IE?

3 views
Skip to first unread message

Doug Crawford

unread,
Mar 1, 2006, 12:19:20 AM3/1/06
to MochiKit
I have been experimenting with the new signal functions using the
development version trunk. Whenever I connect a handler to a link's
"onclick" event I always get a memory leak as reported by Drip-0.3 (the
IE leak detector). Perhaps I am not initializing something properly.
But as a simple example, the following html file will report a leak in
drip and show increasing memory usage when "auto refresh" is run within
Drip.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>test</title>
<script type="text/javascript" src="../js/MochiKit.js"></script>
<script type="text/JavaScript">
function doedit()
{
alert("doedit");
}
function setup()
{
//Drip-0.3 reports a memory leak after the following connect
call
connect("alink", "onclick", doedit);
}
//This connect call works fine and does not report a leak
connect(window, "onload", setup);
</script>
</head>
<body>
<h1>A simple test</h1>
<a href="#" id="alink">alink</a>
</body>
</html>

Beau Hartshorne

unread,
Mar 1, 2006, 3:18:47 PM3/1/06
to Doug Crawford, MochiKit
Thanks for reporting this Doug. This should be fixed in /trunk.
Reply all
Reply to author
Forward
0 new messages