当前位置: 代码迷 >> Web前端 >> DOJO 控件内存储器回收(IE)
  详细解决方案

DOJO 控件内存储器回收(IE)

热度:710   发布时间:2012-10-30 16:13:36.0
DOJO 控件内存回收(IE)

?

if(dojo.isIE){
??? ??? ??? ??? ??? dojox.grid.publicEvents.destroy();????????? //delete events
??? ??? ??? ??? ??? var f = dijit._frames;???????????????????????????? //delete frames
??? ??? ??? ??? ??? f.destroy();
??? ??? ??? ??? ??? dijit.registry.forEach(function(widget){??? //delete widgets
??? ??? ??? ??? ??? ??? widget.destroy();
??? ??? ??? ??? ??? });
??? ??? ??? ??? ??? var cache = dijit._Templated._templateCache;? // delete templates
??? ??? ??? ??? ??? for(var key in cache){
??? ??? ??? ??? ??? ??? var value = cache[key];
??? ??? ??? ??? ??? ??? if(!isNaN(value.nodeType)){????????????????????? // is node equivalent
??? ??? ??? ??? ??? ??? ??? dojo._destroyElement(value);
??? ??? ??? ??? ??? ??? }
??? ??? ??? ??? ??? ??? delete cache[key];
??? ??? ??? ??? ??? }
??? ??? ??? ??? }