Results 1 to 3 of 3

Thread: [Solved - Ext 3.3.1]HtmlEditor memory leak

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1

    Post [Solved - Ext 3.3.1]HtmlEditor memory leak

    error message:
    Code:
    Uncaught TypeError: Cannot read property 'document' of undefined   ext-all-debug.js:43894
    Ext.form.HtmlEditor.Ext.extend.getDoc     ext-all-debug.js:43894
    task.run      ext-all-debug.js:43957
    runTasks     ext-base-debug.js:1134
    there's a task in HtmlEditor never stop when destroy the component. solve the problem now,the code works well now.

    code:
    Code:
    Ext.override(Ext.form.HtmlEditor, {
    	initFrame : function(){
            Ext.TaskMgr.stop(this.monitorTask);
            var doc = this.getDoc();
            this.win = this.getWin();
    
            doc.open();
            doc.write(this.getDocMarkup());
            doc.close();
    
            this.task = { // must defer to wait for browser to be ready
                run : function(){
                    var doc = this.getDoc();
                    if(doc.body || doc.readyState == 'complete'){
                        Ext.TaskMgr.stop(this.task);
                        this.setDesignMode(true);
                        this.initEditor.defer(10, this);
                    }
                },
                interval : 10,
                duration:10000,
                scope: this
            };
            Ext.TaskMgr.start(this.task);
        },
        beforeDestroy : function(){
            if(this.monitorTask){
                Ext.TaskMgr.stop(this.monitorTask);
            }
            if(this.task){
                Ext.TaskMgr.stop(this.task);
            }
            if(this.rendered){
                Ext.destroy(this.tb);
                var doc = this.getDoc();
                if(doc){
                    try{
                        Ext.EventManager.removeAll(doc);
                        for (var prop in doc){
                            delete doc[prop];
                        }
                    }catch(e){}
                }
                if(this.wrap){
                    this.wrap.dom.innerHTML = '';
                    this.wrap.remove();
                }
            }
            Ext.form.HtmlEditor.superclass.beforeDestroy.call(this);
        }
    });
    Last edited by bluethinking; 16 May 2011 at 7:29 PM. Reason: format

  2. #2
    Sencha Premium User
    Join Date
    Jan 2008
    Location
    Germany
    Posts
    538

    Default NOT RESOLVED!

    The issue described by the OP is still valid, his overrides are correct and necessary to avoid a JavaScript error when deleting an HTMLEditor before it has completely been initialized.

    Please adopt the OP's override for the codebase.

  3. #3
    Sencha User
    Join Date
    Apr 2013
    Posts
    914

    Default

    Fun fact: it's 2016 and the same issue is still present in both ExtJS 5.1 and 6.

Similar Threads

  1. memory leak
    By mnask79 in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 29 Oct 2008, 8:38 AM
  2. Replies: 0
    Last Post: 10 Oct 2008, 9:21 AM
  3. [solved] Modal Window Memory Leak?
    By dimitrij.zub in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 9 Aug 2008, 5:40 PM
  4. memory leak???
    By angbob in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 22 May 2008, 12:39 AM
  5. [SOLVED] Memory Leak in Paging Grid Example?
    By cobnet in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 3 May 2007, 8:24 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •