- Timestamp:
- 07/24/07 14:47:27 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Xul_XedLib/chrome/content/scenarixedlib/core/xedDyn.xbl.xml
r9199 r9392 43 43 <implementation> 44 44 <field name="fEditor">this</field> 45 <destructor> 46 this.destroyAllHisto(); 47 </destructor> 45 48 <method name="initEditorDyn"> 46 49 <parameter name="pUrlEditor"/> … … 199 202 vEvent.initEvent(XEDDataChangeEvent, true, false); 200 203 this.fParent.dispatchEvent(vEvent); 204 } 205 vHisto.destroy = function(){ 206 xed.destroyBindings(this.fRemovedNode); 201 207 } 202 208 //Note : il faut dabord ajouter l'histo avant de lancer les events, pour pouvoir ajouter des histo sur cette entrée. … … 1113 1119 - function undo() 1114 1120 - function redo() 1121 - Optionnel : function destroy() pour memLeaks. 1115 1122 --> 1116 1123 <method name="addHisto"> … … 1128 1135 for(var i = 0; i < 20 && vH!=null; i++) vH = vH._EntryPrevHisto; 1129 1136 this.fHistoCount = i; 1130 if(vH) vH._EntryPrevHisto = null; 1137 if(vH) { 1138 var vH2 = vH._EntryPrevHisto; 1139 delete vH._EntryPrevHisto; 1140 if(vH2) delete vH2._EntryNextHisto; 1141 this.xDestroyHisto(vH2); 1142 } 1131 1143 } 1132 1144 } else { … … 1134 1146 } 1135 1147 this.fHistoPrev = pObjHisto; 1136 this.fHistoNext = null; 1148 if(this.fHistoNext) { 1149 this.xDestroyHisto(this.fHistoNext); 1150 this.fHistoNext = null; 1151 } 1137 1152 if(pNewEntry) { 1138 1153 var vEvent = document.createEvent("Events"); … … 1213 1228 ]]></body> 1214 1229 </method> 1215 <!-- champs internes --> 1230 <!-- champs et methodes internes --> 1231 <method name="destroyAllHisto"> 1232 <body><![CDATA[ 1233 this.xDestroyHisto(this.fHistoPrev); 1234 this.xDestroyHisto(this.fHistoNext); 1235 ]]></body> 1236 </method> 1237 <method name="xDestroyHisto"> 1238 <parameter name="pObjHisto"/> 1239 <body><![CDATA[ 1240 var vH = pObjHisto; 1241 while(vH) { 1242 if("destroy" in vH) try {vH.destroy();}catch(e){xed.debug("detroy histo point failed : "+e)} 1243 vH = vH._PrevHisto || vH._EntryPrevHisto; 1244 } 1245 vH = pObjHisto._NextHisto || pObjHisto._EntryNextHisto; 1246 while(vH) { 1247 if("destroy" in vH) try {vH.destroy();}catch(e){xed.debug("detroy histo point failed : "+e)} 1248 vH = vH._NextHisto || vH._EntryNextHisto; 1249 } 1250 ]]></body> 1251 </method> 1216 1252 <field name="fHistoPrev"/> 1217 1253 <field name="fHistoNext"/>
Note: See TracChangeset
for help on using the changeset viewer.