-
1 Mar 2013 4:23 PM #1
[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, {
mousedown: fn, // menu dismisal (MenuManager) and Window onMouseDown (toFront)
mousemove: fn, // window resize drag detection
mouseup: fn, // window resize termination
click: fn, // not sure, but just to be safe
dblclick: fn, // not sure again
scope: me
});
} 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.beforeDestroy, me);
this.el.unmask();
this.fireEvent('load', this);
} else if(me.src && me.src != '') {
this.el.unmask();
this.fireEvent('error', this);
}
},
-
4 Mar 2013 8:05 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,085
- Vote Rating
- 453
Thanks for the report! I have opened a bug in our bug tracker.
You found a bug! We've classified it as
EXTJSIV-8961
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote