vegUI.org home of the javascript based window manager and AJAX framework

Memory Leak in IE, vegUI3 ?

written by vegu on 15 Jan, 2009 12:40:00
In response to an email i got regarding a memory leak in IE.

Greetings,

Thanks for the bug report.

I tracked the memory leak down, and ironically it has to do with the iesucks function, that apparently wasnt good enough...



go into vegui.std.js and replace the old iesucks function with the new one below.

code: js

/** NEW IESUCKS FUNCTION */

function iesucks(Node) {
var i;

if(Node.nodeName != '#text') {

var n;

for(n in Node) {
if(n.indexOf('on') == 0)
Node[n] = null;
}

for(i in Node.childNodes)
iesucks(Node.childNodes[i]);
}
}


then in the same file look for the clear() method and replace with the new version below

code: js

this.clear = function(replacement) {
if(!this.Base)
return 0;
while(this.Base.childNodes[0]) {
if((browser_str.indexOf('msie')+1))
iesucks(this.Base.childNodes[0]);

this.Base.removeChild(this.Base.childNodes[0]);
}
if(replacement)
this.Base.appendChild(replacement);
};


Hope this fixed your problem.

Alas vegUI 2 isnt being maintained and worked on any longer, i will probably push a fixed version at some point but until then use this fix, look forward to vegUI 3 coming sometime this spring ;)

Stefan

PS: It's kinda ridiculous that MS transfered that leak over to IE 7 from IE 6... so ridiculous its awesome again...

Related Posts

  • No related posts



Comments have been temporarily disabled because of abuse, they will be back once i figure out how to deal with this the best way. In the meanwhile if you are having questions regarding one of my scripts / tutorials please dont hesitate to email me at vegu AT vegui.org. Thanks for understanding!

Comments

No comments yet.