XMLHttpRequest导致IE 7+中的内存泄漏 [英] XMLHttpRequest causing Memory Leak in IE 7+

查看:163
本文介绍了XMLHttpRequest导致IE 7+中的内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在以下代码中发现内存泄漏(else块)

I found a memory leak in the following code (the else block)

if (browser == "Microsoft Internet Explorer"){
    if (vers < 7){
        document.getElementById("theData").src = "data.js";
    }else{
            xmlHTTP = new XMLHttpRequest();
            xmlHTTP.open('GET', "data.js", false);
            xmlHTTP.send(null);
            eval(xmlHTTP.responseText);
            window.execScript(xmlHTTP.responseText);
            xmlHTTP = null;
            delete xmlHTTP;
    }
}else{
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'data.js';
    document.getElementsByTagName('head')[0].appendChild(script);
}//end if
refreshCount=0;



非常感谢你的帮助!


Your help is appreciated!

推荐答案

我认为你无法做到关于它的任何事情。



你确定你真的发现了泄漏吗?怎么样?并非所有方法都可靠。无论如何,如果你确实有泄漏,你无法阻止它。所有投诉都归微软所有:-(



-SA
I don''t think you can do anything about it.

Are you sure you really detected the leak? How? Not all methods are reliable. Anyway, if you do have a leak, you cannot prevent it. All complains go to Microsoft :-(

—SA


这篇关于XMLHttpRequest导致IE 7+中的内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆