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/libUiBase/widgets/xedUiRichTextInput.xbl.xml

    r9384 r9392  
    5959                <implementation> 
    6060                        <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"); 
    6163                                this.fRichTextZone.fRichTextInput = this; 
    6264                        </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> 
    6471                        <property name="realvalue"> 
    6572                                <getter>                                 
     
    274281                        <!-- API nsIControllers de l'editor. --> 
    275282                        <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"/> 
    276285                        <!-- Champ affecté par le RichTextInput pour retrouver l'input propriétaire de cette Zone. --> 
    277286                        <field name="fRichTextInput"/> 
    278287                        <!-- Noeud Editor (construit dynamiquement). --> 
    279288                        <field name="fEditorNode">document.getAnonymousElementByAttribute(this, "type", "content-primary")</field> 
    280                         <destructor><![CDATA[ 
    281                                 this.resetEditor(true); 
    282                         ]]></destructor> 
    283289                        <!-- Permet de redéfinir sa hauteur par rapport au contenu (appelé par le RichTextInput propriétaire) --> 
    284290                        <method name="autoSize"> 
     
    314320                                                //La commande cmd_bold est utilisée comme proxy pour toute modification potentielle de style lié au caret ou à la sélection. 
    315321                                                //cette commande est déclenchée par Mozilla en asynchrone lorsque le caret s'est stabilisé. 
    316                                                 this.fEditorNode.commandManager.removeCommandObserver(this.fObserver, "cmd_bold"); 
     322                                                this.fCommandManager.removeCommandObserver(this.fObserver, "cmd_bold"); 
    317323                                                delete this.fObserver.fXbl; //memLeak 
    318324                                                delete this.fObserver; //memLeak 
     
    336342                                try{ 
    337343                                        var vDoc = this.fEditorNode.contentDocument; 
     344                                        this.fCommandManager = this.fEditorNode.commandManager; 
    338345                                        // On remplit le document de l'éditeur 
    339346                                        this.fHtmlRoot = vDoc.body; 
     
    409416                                                                //La commande cmd_bold est utilisée comme proxy pour toute modification potentielle de style lié au caret ou à la sélection. 
    410417                                                                //cette commande est déclenchée par Mozilla en asynchrone lorsque le caret s'est stabilisé. 
    411                                                                 vXbl.fEditorNode.commandManager.addCommandObserver(vXbl.fObserver, "cmd_bold"); 
     418                                                                vXbl.fCommandManager.addCommandObserver(vXbl.fObserver, "cmd_bold"); 
    412419                                                        } 
    413420                 
     
    434441                                                finally { 
    435442                                                        //Init ok on se désabonne. 
    436                                                         vXbl.fEditorNode.commandManager.removeCommandObserver(this, "obs_documentCreated"); 
     443                                                        vXbl.fCommandManager.removeCommandObserver(this, "obs_documentCreated"); 
    437444                                                } 
    438445                                                 
    439446                                        } 
    440447 
    441                                         this.fEditorNode.commandManager.addCommandObserver(vObserveCreateEditor, "obs_documentCreated"); 
     448                                        this.fCommandManager.addCommandObserver(vObserveCreateEditor, "obs_documentCreated"); 
    442449                                        this.fEditorNode.makeEditable(vMethodEditor, false); 
    443450                                 
Note: See TracChangeset for help on using the changeset viewer.