Ignore:
Timestamp:
07/24/07 14:47:27 (5 years ago)
Author:
sys
Message:

memLeaks : ajout de la méthode destroy() pour compenser l'absence d'appel des destructor des XBL si les éléments ont été extraits du Document.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Xul_XedLib/chrome/content/scenarixedlib/core/xed.js

    r9384 r9392  
    394394                                return (sPropertyName in pNode) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; 
    395395                        }, false); 
    396                 return vTw.firstChild(); 
     396                var vRes = vTw.firstChild(); 
     397                vTw = null; //memLeak 
     398                return vRes; 
    397399        } 
    398400        return null; 
     
    12911293                } 
    12921294                vEditor.setFocusFrom(vFirstNode); 
    1293         } 
     1295                delete this.fFrag; 
     1296        } 
     1297} 
     1298XEDInsertHisto.prototype.destroy = function(){ 
     1299        if(this.fFrag) xed.destroyBindings(this.fFrag); 
    12941300} 
    12951301 
     
    13291335} 
    13301336 
     1337XEDReplaceHisto.prototype.destroy = function(){ 
     1338        xed.destroyBindings(this.fOldBind.parentNode ? this.fNewBind : this.fOldBind); 
     1339} 
    13311340 
    13321341//************************************************************************************** 
     
    17161725        return vS+"]"; 
    17171726} 
     1727 
     1728xed.destroyBindings = function(pNode) { 
     1729        if(!pNode) return; 
     1730        function callDestroy(pNode){ 
     1731                try { 
     1732                        if("destroy" in pNode) pNode.destroy(); 
     1733                } catch(e){xed.debug("destroyNode failed : "+pNode.localName+"\n"+e);} 
     1734                return NodeFilter.FILTER_ACCEPT; 
     1735        } 
     1736        callDestroy(pNode); 
     1737        var vTw = pNode.ownerDocument.createTreeWalker(pNode, NodeFilter.SHOW_ELEMENT, callDestroy, false); 
     1738        while(vTw.nextNode()); 
     1739        vTw = null; //memLeak 
     1740} 
     1741 
    17181742/** Protège les -- par des -~- et plus généralement -(X)~- par -(X+)~- pour les commentaires imbriqués. */ 
    17191743xed.escapeComment = function(pText){ 
Note: See TracChangeset for help on using the changeset viewer.