atom feed22 messages in com.googlegroups.jquery-en[jQuery] Memory leaks forever
FromSent OnAttachments
Franck MarciaMar 25, 2006 7:13 am 
Dave MethvinMar 25, 2006 8:55 am 
Franck MarciaMar 25, 2006 9:08 am 
John ResigMar 25, 2006 9:15 am 
Dave MethvinMar 25, 2006 10:07 am 
Michael GearyMar 25, 2006 10:07 am 
Franck MarciaMar 25, 2006 10:39 am 
Michael GearyMar 25, 2006 10:56 am 
Dave MethvinMar 25, 2006 11:05 am 
Franck MarciaMar 25, 2006 1:45 pm 
Michael GearyMar 25, 2006 2:19 pm 
Franck MarciaMar 25, 2006 5:16 pm 
Dave MethvinMar 26, 2006 9:02 am 
Michael GearyMar 26, 2006 1:24 pm 
Franck MarciaMar 28, 2006 2:25 am 
Dave MethvinMar 28, 2006 5:45 am 
John ResigMar 28, 2006 7:30 am 
Franck MarciaMar 28, 2006 8:26 am 
jqu...@vikas.mailshell.comMar 28, 2006 8:57 am 
John ResigMar 28, 2006 9:03 am 
Michael GearyMar 28, 2006 9:14 am 
jqu...@vikas.mailshell.comMar 28, 2006 9:24 am 
Subject:[jQuery] Memory leaks forever
From:Franck Marcia (fran@gmail.com)
Date:Mar 25, 2006 7:13:12 am
List:com.googlegroups.jquery-en

Hi,

I'm working on an interface which builds lists with data retrieved by XHR. Every item of the list has got several functions bounded to click event. And it seems that a lot of memory leaks, with IE, of course.

Basically, here is the structure of the code:

var myList = {};

myList.build = function(id) { ... var myVars = []; for (var i in items) { $('#content').append( myVars[i] = $.DIV(...) ... } ... for (var i in myVars) $(myVars[i]).bind('click', myList.react); ... };

list.react = function(e) { ... };

var controler = {};

controller.init = function() { ... switch(action) { ... case 'xxx': dollar_dot_post_wrapper(url, params, myList.build, id); break; ... } ... };

$(document).ready( controller.init(); $(controller.menu[0]).trigger('click'); };

Is it because of the code structure? Because I'm using static functions? Did I misuse jQuery?

I tried to use the work of Lauren van den Oever (http://laurens.vd.oever.nl/weblog/items2005/closures/), I tried to used a kind of event garbage collector of my own. I even tried to use prototype events management (sorry, it was before I found out the work of Dean Edwards, then the coding contest of ppk). Nothing's been working.

Could somebody help me?

Franck.