I have a Component which I am using as a message toast.
Ext.Animator.managedListeners['ext-fx-animation-slide-5'].destroy[0].scope
Any Idea why these memory leaks are occurring and what I can do to avoid them?
Memory Leak Help - ext-fx-animation-slide
The Component requires Ext.sheet to take advantage of hideAnimation/showAnimation
I am adding a couple listeners to detect when the component is shown/hidden so that I can hide the component after its shown and then destroy the component after its hidden.
Code:
Ext.define("Ext.ux.toast.MessageToast", { extend: 'Ext.Component',
requires: [
'Ext.Sheet'
],
xtype: 'messagetoast',
config: {
message: '',
html : '',
hideAnimation: {
type: 'slideOut',
direction: 'up',
duration: 1000
},
showAnimation: {
type: 'slideIn',
duration: 1000,
direction: 'down'
},
hidden: true,
inAnimation: false
},
initialize: function(){
var me = this;
this.setHtml(this.getMessage());
this.addCls("messagetoast");
this.addListener({show:function(){setTimeout(function(){me.hide();},2000);}});
this.addListener({hide:function(){me.destroy();}});
this.callParent(arguments);
},
showToast: function() {
Ext.Viewport.add(this);
this.show();
},
showToastIn: function(container) {
var me = this;
container.add(me);
me.show();
}
});
If I repeat the process of creating and destroying MessageToast Components then I get memory leaks.
In the Ext.Animator.managedListeners there are some classes associated with the MessageToast components I am creating which never get cleared out.
E.g.
I can find the following class which never gets cleared out after a destroy.
Ext.Animator.managedListeners['ext-fx-animation-slide-5'].destroy[0].scope
Code:
_direction: "down"
_duration: 1000
_easing: "ease-out"
_element: Ext.apply.create.Class
_onEnd: function () {config: Ext.Object.classify.objectClasseventDispatcher: Ext.apply.create.ClassgetEventDispatcher: function () {getId: function () {getObservableId: function () {getUniqueId: function () {id: "ext-fx-animation-slide-5"initConfig: function (){}initialConfig: Ext.Object.classify.objectClassinitialized: truemanagedListeners: ObjectobservableId: "#ext-fx-animation-slide-5"startTime: 1423188952847states: ObjectusedSelectors: Array[1]__proto__:
Any Idea why these memory leaks are occurring and what I can do to avoid them?
Thank you
Memory Leak Help - ext-fx-animation-slide
Aucun commentaire:
Enregistrer un commentaire