AJAX - Finally 로 IE6 메모리 누수 해결

|

메모리 누수 문제로 몇일 동안 헤메던중에 발견한것인데, 
가능할것도 같아서 발췌해서 링크 걸어요.. 
IE8 beta 에 적용해서 해보았습니다. 

링크 거신곳으로 가보시면 더 많은 자료가 있드라구요.. 

주소 : http://www.hedgerwow.com/360/dhtml/ie6_memory_leak_fix/ 

핵심은 
      var obj = document.createElement("button"); 
      ................. 
      ................. 
      try { 
        return obj; 
      } finally { 
        obj = null; 
      } 

이것입니다.. 


    /** 
    * Use the try ... finally statement to resolve the memory leak issue 
    */ 
    function createButton() { 
      var obj = document.createElement("button"); 
      obj.innerHTML = "click me"; 
      obj.onclick = function() { 
        //handle onclick 
      } 
      obj.onmouseover = function() { 
        //handle onmouseover 
      } 

      //this helps to fix the memory leak issue 
      try { 
        return obj; 

      } finally { 
        obj = null; 
      } 
    } 


    var dButton = document.getElementsById("d1").appendChild(createButton()); 

----------------------

링크

 

http://rhio.tistory.com/222

http://rhio.tistory.com/208

http://www.comefeel.com/tt/comefeel/357

http://msdn.microsoft.com/en-us/library/bb250448.aspx

http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx

And