Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-8961 in 4.2.1.744.
  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    13
    Vote Rating
    0
    bladesling is on a distinguished road

      0  

    Default [BUG] Ext.ux.IFrame memory leak

    [BUG] Ext.ux.IFrame memory leak


    In the onLoad function on the iFrame you have
    Ext.EventManager.on(window, 'unload', me.beforeDestroy, me);

    I believe you meant to add the listener to the iframe and not the window, or possibly both. It leaks a listener each time you load a URL when you don't have
    Ext.EventManager.on(me.getWin(), 'unload', me.beforeDestroy, me);

    The window event listener needs to be moved from the onLoad function if it helps with unloads of the window, but if it was meant for the iframe, then it needs to reference the iframe. Or maybe you need to put one on both.

    Relevant code:
    PHP Code:
        onLoad: function() {
            var 
    me this,
                
    doc me.getDoc(),
                
    fn me.onRelayedEvent;
     
            if (
    doc) {
                try {
                    
    Ext.EventManager.removeAll(doc);
     
                    
    // These events need to be relayed from the inner document (where they stop
                    // bubbling) up to the outer document. This has to be done at the DOM level so
                    // the event reaches listeners on elements like the document body. The effected
                    // mechanisms that depend on this bubbling behavior are listed to the right
                    // of the event.
                    
    Ext.EventManager.on(doc, {
                        
    mousedownfn// menu dismisal (MenuManager) and Window onMouseDown (toFront)
                        
    mousemovefn// window resize drag detection
                        
    mouseupfn,   // window resize termination
                        
    clickfn,     // not sure, but just to be safe
                        
    dblclickfn,  // not sure again
                        
    scopeme
                    
    });
                } catch(
    e) {
                    
    // cannot do this xss
                
    }
     
                
    // We need to be sure we remove all our events from the iframe on unload or we're going to LEAK!
                
    Ext.EventManager.on(window'unload'me.beforeDestroyme);
     
                
    this.el.unmask();
                
    this.fireEvent('load'this);
     
            } else if(
    me.src && me.src != '') {
     
                
    this.el.unmask();
                
    this.fireEvent('error'this);
            }
     
     
        }, 

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,065
    Vote Rating
    852
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

Thread Participants: 1