Changeset 9392
- Timestamp:
- 24.07.2007 14:47:27 (3 years ago)
- Location:
- trunk
- Files:
-
- 10 modified
-
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 393 393 return (sPropertyName in pNode) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; 394 394 }, false); 395 return vTw.firstChild(); 395 var vRes = vTw.firstChild(); 396 vTw = null; //memLeak 397 return vRes; 396 398 } 397 399 return null; … … 1290 1292 } 1291 1293 vEditor.setFocusFrom(vFirstNode); 1292 } 1294 delete this.fFrag; 1295 } 1296 } 1297 XEDInsertHisto.prototype.destroy = function(){ 1298 if(this.fFrag) xed.destroyBindings(this.fFrag); 1293 1299 } 1294 1300 … … 1328 1334 } 1329 1335 1336 XEDReplaceHisto.prototype.destroy = function(){ 1337 xed.destroyBindings(this.fOldBind.parentNode ? this.fNewBind : this.fOldBind); 1338 } 1330 1339 1331 1340 //************************************************************************************** … … 1713 1722 return vS+"]"; 1714 1723 } 1724 1725 xed.destroyBindings = function(pNode) { 1726 if(!pNode) return; 1727 function callDestroy(pNode){ 1728 try { 1729 if("destroy" in pNode) pNode.destroy(); 1730 } catch(e){xed.debug("destroyNode failed : "+pNode.localName+"\n"+e);} 1731 return NodeFilter.FILTER_ACCEPT; 1732 } 1733 callDestroy(pNode); 1734 var vTw = pNode.ownerDocument.createTreeWalker(pNode, NodeFilter.SHOW_ELEMENT, callDestroy, false); 1735 while(vTw.nextNode()); 1736 vTw = null; //memLeak 1737 } 1738 1715 1739 /** Prot� les -- par des -~- et plus g�ralement -(X)~- par -(X+)~- pour les commentaires imbriqu� */ 1716 1740 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� … … 1111 1117 - function undo() 1112 1118 - function redo() 1119 - Optionnel : function destroy() pour memLeaks. 1113 1120 --> 1114 1121 <method name="addHisto"> … … 1126 1133 for(var i = 0; i < 20 && vH!=null; i++) vH = vH._EntryPrevHisto; 1127 1134 this.fHistoCount = i; 1128 if(vH) vH._EntryPrevHisto = null; 1135 if(vH) { 1136 var vH2 = vH._EntryPrevHisto; 1137 delete vH._EntryPrevHisto; 1138 if(vH2) delete vH2._EntryNextHisto; 1139 this.xDestroyHisto(vH2); 1140 } 1129 1141 } 1130 1142 } else { … … 1132 1144 } 1133 1145 this.fHistoPrev = pObjHisto; 1134 this.fHistoNext = null; 1146 if(this.fHistoNext) { 1147 this.xDestroyHisto(this.fHistoNext); 1148 this.fHistoNext = null; 1149 } 1135 1150 if(pNewEntry) { 1136 1151 var vEvent = document.createEvent("Events"); … … 1211 1226 ]]></body> 1212 1227 </method> 1213 <!-- champs internes --> 1228 <!-- champs et methodes internes --> 1229 <method name="destroyAllHisto"> 1230 <body><![CDATA[ 1231 this.xDestroyHisto(this.fHistoPrev); 1232 this.xDestroyHisto(this.fHistoNext); 1233 ]]></body> 1234 </method> 1235 <method name="xDestroyHisto"> 1236 <parameter name="pObjHisto"/> 1237 <body><![CDATA[ 1238 var vH = pObjHisto; 1239 while(vH) { 1240 if("destroy" in vH) try {vH.destroy();}catch(e){xed.debug("detroy histo point failed : "+e)} 1241 vH = vH._PrevHisto || vH._EntryPrevHisto; 1242 } 1243 vH = pObjHisto._NextHisto || pObjHisto._EntryNextHisto; 1244 while(vH) { 1245 if("destroy" in vH) try {vH.destroy();}catch(e){xed.debug("detroy histo point failed : "+e)} 1246 vH = vH._NextHisto || vH._EntryNextHisto; 1247 } 1248 ]]></body> 1249 </method> 1214 1250 <field name="fHistoPrev"/> 1215 1251 <field name="fHistoNext"/> -
trunk/Xul_XedLib/chrome/content/scenarixedlib/core/xedUi.xbl.xml
r9383 r9392 664 664 } 665 665 ]]></constructor> 666 <destructor> 667 //memoryleaks 666 <destructor>this.destroy();</destructor> 667 <method name="destroy"> 668 <body> 669 //memLeaks 668 670 this.fTimerFocus.cancel(); 669 671 this.fTimerFocus = null; … … 671 673 this.fTabTw = null; 672 674 this.fLineTw = null; 673 </destructor> 675 </body> 676 </method> 674 677 <field name="fIsRootEditor">true</field> 675 678 <field name="fEditor"/> … … 946 949 else this.parentNode.fVerticalScrollbar = this; 947 950 ]]></constructor> 948 <destructor><![CDATA[ 949 if (this.orient == 'horizontal') this.parentNode.fHorizontalScrollbar = null; 950 else this.parentNode.fVerticalScrollbar = null; 951 ]]></destructor> 951 952 <destructor>this.destroy();</destructor> 953 <method name="destroy"> 954 <body><![CDATA[ 955 if (this.orient == 'horizontal') this.parentNode.fHorizontalScrollbar = null; 956 else this.parentNode.fVerticalScrollbar = null; 957 ]]></body> 958 </method> 952 959 </implementation> 953 960 </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�alisation 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�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> … … 273 280 <!-- API nsIControllers de l'editor. --> 274 281 <field name="fControllers"/> 282 <!-- API nsICommandManager de l'editor (oblig�e le m�rise sinon impossible de le r�p� si node d�och�u doc). --> 283 <field name="fCommandManager"/> 275 284 <!-- Champ affect�ar le RichTextInput pour retrouver l'input propri�ire de cette Zone. --> 276 285 <field name="fRichTextInput"/> 277 286 <!-- Noeud Editor (construit dynamiquement). --> 278 287 <field name="fEditorNode">document.getAnonymousElementByAttribute(this, "type", "content-primary")</field> 279 <destructor><![CDATA[280 this.resetEditor(true);281 ]]></destructor>282 288 <!-- Permet de red�nir sa hauteur par rapport au contenu (appel�ar le RichTextInput propri�ire) --> 283 289 <method name="autoSize"> … … 313 319 //La commande cmd_bold est utilis�comme proxy pour toute modification potentielle de style li�u caret ou �a s�ction. 314 320 //cette commande est d�ench�par Mozilla en asynchrone lorsque le caret s'est stabilis� 315 this.f EditorNode.commandManager.removeCommandObserver(this.fObserver, "cmd_bold");321 this.fCommandManager.removeCommandObserver(this.fObserver, "cmd_bold"); 316 322 delete this.fObserver.fXbl; //memLeak 317 323 delete this.fObserver; //memLeak … … 335 341 try{ 336 342 var vDoc = this.fEditorNode.contentDocument; 343 this.fCommandManager = this.fEditorNode.commandManager; 337 344 // On remplit le document de l'�teur 338 345 this.fHtmlRoot = vDoc.body; … … 408 415 //La commande cmd_bold est utilis�comme proxy pour toute modification potentielle de style li�u caret ou �a s�ction. 409 416 //cette commande est d�ench�par Mozilla en asynchrone lorsque le caret s'est stabilis� 410 vXbl.f EditorNode.commandManager.addCommandObserver(vXbl.fObserver, "cmd_bold");417 vXbl.fCommandManager.addCommandObserver(vXbl.fObserver, "cmd_bold"); 411 418 } 412 419 … … 433 440 finally { 434 441 //Init ok on se d�bonne. 435 vXbl.f EditorNode.commandManager.removeCommandObserver(this, "obs_documentCreated");442 vXbl.fCommandManager.removeCommandObserver(this, "obs_documentCreated"); 436 443 } 437 444 438 445 } 439 446 440 this.f EditorNode.commandManager.addCommandObserver(vObserveCreateEditor, "obs_documentCreated");447 this.fCommandManager.addCommandObserver(vObserveCreateEditor, "obs_documentCreated"); 441 448 this.fEditorNode.makeEditable(vMethodEditor, false); 442 449