Changeset 9392
- Timestamp:
- 07/24/07 14:47:27 (5 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
Xul_Cms/chrome/content/scenaricms/widgets/item/item.xbl.xml (modified) (1 diff)
-
Xul_Cms/chrome/content/scenaricms/xed/libUiCms/providers/wspInputHistoryProvider.xbl.xml (modified) (1 diff)
-
Xul_Cms/chrome/content/scenaricms/xed/libUiCms/widgets/xedUiCms.xbl.xml (modified) (1 diff)
-
Xul_XedLib/chrome/content/scenarixedlib/core/xed.js (modified) (4 diffs)
-
Xul_XedLib/chrome/content/scenarixedlib/core/xedDyn.xbl.xml (modified) (6 diffs)
-
Xul_XedLib/chrome/content/scenarixedlib/core/xedUi.xbl.xml (modified) (3 diffs)
-
Xul_XedLib/chrome/content/scenarixedlib/libUiBase/providers/fixedProvider.xbl.xml (modified) (1 diff)
-
Xul_XedLib/chrome/content/scenarixedlib/libUiBase/widgets/xedUiHelp.xbl.xml (modified) (1 diff)
-
Xul_XedLib/chrome/content/scenarixedlib/libUiBase/widgets/xedUiInputs.xbl.xml (modified) (3 diffs)
-
Xul_XedLib/chrome/content/scenarixedlib/libUiBase/widgets/xedUiRichTextInput.xbl.xml (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Xul_Cms/chrome/content/scenaricms/widgets/item/item.xbl.xml
r9158 r9392 103 103 this.xUpdateVal(); 104 104 ]]></constructor> 105 <destructor> 105 <destructor>this.destroy();</destructor> 106 <method name="destroy"> 107 <body> 106 108 if(this.fLastUri) this.fUriObject.removeUpdateListener(this, this.fLastUri); 107 </destructor> 109 </body> 110 </method> 108 111 <property name="cd" onget="return this.fCd"/> 109 112 <property name="sp" onget="return (this.fSp || ! this.fUriObject) ? this.fSp : ut.getSpaceFromUri(this.fUriObject.getUri());"/> -
trunk/Xul_Cms/chrome/content/scenaricms/xed/libUiCms/providers/wspInputHistoryProvider.xbl.xml
r5707 r9392 43 43 <implementation implements="nsIAutoCompleteSearch"> 44 44 <constructor>this.fId = this.fACSearchProxy.registerProvider(this.QueryInterface(Components.interfaces.nsIAutoCompleteSearch));</constructor> 45 <destructor>this.fACSearchProxy.unregisterProvider(this.fId); </destructor> 45 <destructor>this.destroy();</destructor> 46 <method name="destroy"> 47 <body>this.fACSearchProxy.unregisterProvider(this.fId);</body> 48 </method> 46 49 <field name="fACSearchProxy">Components.classes["@mozilla.org/autocomplete/search;1?name=scProxy"].getService(Components.interfaces.scIAutoCompleteSearchProxy);</field> 47 50 <field name="fId"/> -
trunk/Xul_Cms/chrome/content/scenaricms/xed/libUiCms/widgets/xedUiCms.xbl.xml
r8970 r9392 89 89 }catch(e){xed.debug("ptritem failed:"+e);} 90 90 </constructor> 91 <method name="destroy"> 92 <body> 93 this.fItemEdit.destroy(); 94 </body> 95 </method> 91 96 <method name="onxedload"> 92 97 <body><![CDATA[ -
trunk/Xul_XedLib/chrome/content/scenarixedlib/core/xed.js
r9384 r9392 394 394 return (sPropertyName in pNode) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; 395 395 }, false); 396 return vTw.firstChild(); 396 var vRes = vTw.firstChild(); 397 vTw = null; //memLeak 398 return vRes; 397 399 } 398 400 return null; … … 1291 1293 } 1292 1294 vEditor.setFocusFrom(vFirstNode); 1293 } 1295 delete this.fFrag; 1296 } 1297 } 1298 XEDInsertHisto.prototype.destroy = function(){ 1299 if(this.fFrag) xed.destroyBindings(this.fFrag); 1294 1300 } 1295 1301 … … 1329 1335 } 1330 1336 1337 XEDReplaceHisto.prototype.destroy = function(){ 1338 xed.destroyBindings(this.fOldBind.parentNode ? this.fNewBind : this.fOldBind); 1339 } 1331 1340 1332 1341 //************************************************************************************** … … 1716 1725 return vS+"]"; 1717 1726 } 1727 1728 xed.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 1718 1742 /** Protège les -- par des -~- et plus généralement -(X)~- par -(X+)~- pour les commentaires imbriqués. */ 1719 1743 xed.escapeComment = function(pText){ -
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"/> -
trunk/Xul_XedLib/chrome/content/scenarixedlib/core/xedUi.xbl.xml
r9383 r9392 666 666 } 667 667 ]]></constructor> 668 <destructor> 669 //memoryleaks 668 <destructor>this.destroy();</destructor> 669 <method name="destroy"> 670 <body> 671 //memLeaks 670 672 this.fTimerFocus.cancel(); 671 673 this.fTimerFocus = null; … … 673 675 this.fTabTw = null; 674 676 this.fLineTw = null; 675 </destructor> 677 </body> 678 </method> 676 679 <field name="fIsRootEditor">true</field> 677 680 <field name="fEditor"/> … … 948 951 else this.parentNode.fVerticalScrollbar = this; 949 952 ]]></constructor> 950 <destructor><![CDATA[ 951 if (this.orient == 'horizontal') this.parentNode.fHorizontalScrollbar = null; 952 else this.parentNode.fVerticalScrollbar = null; 953 ]]></destructor> 953 954 <destructor>this.destroy();</destructor> 955 <method name="destroy"> 956 <body><![CDATA[ 957 if (this.orient == 'horizontal') this.parentNode.fHorizontalScrollbar = null; 958 else this.parentNode.fVerticalScrollbar = null; 959 ]]></body> 960 </method> 954 961 </implementation> 955 962 </binding> -
trunk/Xul_XedLib/chrome/content/scenarixedlib/libUiBase/providers/fixedProvider.xbl.xml
r5676 r9392 45 45 this.fId = this.fACSearchProxy.registerProvider(this.QueryInterface(Components.interfaces.nsIAutoCompleteSearch)); 46 46 </constructor> 47 <destructor>this.fACSearchProxy.unregisterProvider(this.fId); </destructor> 47 <destructor>this.destroy();</destructor> 48 <method name="destroy"> 49 <body>this.fACSearchProxy.unregisterProvider(this.fId);</body> 50 </method> 48 51 <field name="fACSearchProxy">Components.classes["@mozilla.org/autocomplete/search;1?name=scProxy"].getService(Components.interfaces.scIAutoCompleteSearchProxy);</field> 49 52 <field name="fId"/> -
trunk/Xul_XedLib/chrome/content/scenarixedlib/libUiBase/widgets/xedUiHelp.xbl.xml
r8595 r9392 59 59 vEditor.fContent.addFocusStabilizedListener(this); 60 60 </constructor> 61 <destructor> 61 <destructor>this.destroy();</destructor> 62 <method name="destroy"> 63 <body> 62 64 var vEditor = xed.getEditor(this); 63 65 vEditor.fContent.removeFocusStabilizedListener(this); 64 </destructor> 66 </body> 67 </method> 65 68 <method name="focusStabilized"> 66 69 <parameter name="pNode"/> -
trunk/Xul_XedLib/chrome/content/scenarixedlib/libUiBase/widgets/xedUiInputs.xbl.xml
r9384 r9392 318 318 </content> 319 319 <implementation> 320 <field name="fInputField">document.getAnonymousElementByAttribute(this, "anonid", "input")</field>321 320 <property name="filtercr" onget="return this.getAttribute('filtercr')!='false'" onset="this.setAttribute('filtercr', val); return val;"/> 322 321 <property name="filterspaces" onget="return this.getAttribute('filterspaces')!='false'" onset="this.setAttribute('filterspaces', val); return val;"/> … … 324 323 <property name="filterSpecialCars" onget="return this.getAttribute('filterSpecialCars')!='false'" onset="this.setAttribute('filterSpecialCars', val); return val;"/> 325 324 <constructor> 325 if(this.fInputField) this.destroy(); //Nouvel appel constructor, gestion memLeaks 326 this.fInputField = document.getAnonymousElementByAttribute(this, "anonid", "input"); 326 327 //Surcharge de la property value pour court-circuiter la sérialisation et la suppression des espaces inseccables. 327 328 this.fInputField.__defineGetter__("value", this.__valueGetter); … … 330 331 this.fInputField.controllers.insertControllerAt(0, this.fXEDInputController); 331 332 </constructor> 332 <destructor> 333 try{ 334 this.fXEDInputController.destroy(); 335 this.fXEDInputController = null; 336 this.fInputField.controllers.removeControllerAt(0); 337 }catch(e){xed.debug("destructor:::::::"+e);} 338 </destructor> 333 <destructor>this.destroy();</destructor> 334 <method name="destroy"> 335 <body> 336 this.fXEDInputController.destroy(); 337 this.fXEDInputController = null; 338 this.fInputField.controllers.removeControllerAt(0); 339 </body> 340 </method> 339 341 <method name="__valueGetter"> 340 342 <body> -
trunk/Xul_XedLib/chrome/content/scenarixedlib/libUiBase/widgets/xedUiRichTextInput.xbl.xml
r9384 r9392 59 59 <implementation> 60 60 <constructor> 61 if(this.fRichTextZone) this.fRichTextZone.resetEditor(); //Nouvel appel constructor : gestion memLeak instance précédente. 62 this.fRichTextZone = document.getAnonymousElementByAttribute(this, "anonid", "richText"); 61 63 this.fRichTextZone.fRichTextInput = this; 62 64 </constructor> 63 <field name="fRichTextZone">document.getAnonymousElementByAttribute(this, "anonid", "richText")</field> 65 <destructor>this.destroy();</destructor> 66 <method name="destroy"> 67 <body> 68 this.fRichTextZone.resetEditor(); 69 </body> 70 </method> 64 71 <property name="realvalue"> 65 72 <getter> … … 274 281 <!-- API nsIControllers de l'editor. --> 275 282 <field name="fControllers"/> 283 <!-- API nsICommandManager de l'editor (obligé de le mémorise sinon impossible de le récupére si node décroché du doc). --> 284 <field name="fCommandManager"/> 276 285 <!-- Champ affecté par le RichTextInput pour retrouver l'input propriétaire de cette Zone. --> 277 286 <field name="fRichTextInput"/> 278 287 <!-- Noeud Editor (construit dynamiquement). --> 279 288 <field name="fEditorNode">document.getAnonymousElementByAttribute(this, "type", "content-primary")</field> 280 <destructor><![CDATA[281 this.resetEditor(true);282 ]]></destructor>283 289 <!-- Permet de redéfinir sa hauteur par rapport au contenu (appelé par le RichTextInput propriétaire) --> 284 290 <method name="autoSize"> … … 314 320 //La commande cmd_bold est utilisée comme proxy pour toute modification potentielle de style lié au caret ou à la sélection. 315 321 //cette commande est déclenchée par Mozilla en asynchrone lorsque le caret s'est stabilisé. 316 this.f EditorNode.commandManager.removeCommandObserver(this.fObserver, "cmd_bold");322 this.fCommandManager.removeCommandObserver(this.fObserver, "cmd_bold"); 317 323 delete this.fObserver.fXbl; //memLeak 318 324 delete this.fObserver; //memLeak … … 336 342 try{ 337 343 var vDoc = this.fEditorNode.contentDocument; 344 this.fCommandManager = this.fEditorNode.commandManager; 338 345 // On remplit le document de l'éditeur 339 346 this.fHtmlRoot = vDoc.body; … … 409 416 //La commande cmd_bold est utilisée comme proxy pour toute modification potentielle de style lié au caret ou à la sélection. 410 417 //cette commande est déclenchée par Mozilla en asynchrone lorsque le caret s'est stabilisé. 411 vXbl.f EditorNode.commandManager.addCommandObserver(vXbl.fObserver, "cmd_bold");418 vXbl.fCommandManager.addCommandObserver(vXbl.fObserver, "cmd_bold"); 412 419 } 413 420 … … 434 441 finally { 435 442 //Init ok on se désabonne. 436 vXbl.f EditorNode.commandManager.removeCommandObserver(this, "obs_documentCreated");443 vXbl.fCommandManager.removeCommandObserver(this, "obs_documentCreated"); 437 444 } 438 445 439 446 } 440 447 441 this.f EditorNode.commandManager.addCommandObserver(vObserveCreateEditor, "obs_documentCreated");448 this.fCommandManager.addCommandObserver(vObserveCreateEditor, "obs_documentCreated"); 442 449 this.fEditorNode.makeEditable(vMethodEditor, false); 443 450
Note: See TracChangeset
for help on using the changeset viewer.