fix updateStore destroy

the store never fires/gets a destroy event, thus it
never stops the load_task and never unqueues itself in case
the store gets destroyed but not explicitely stopped

with overriding the destroy method, this works now as intended

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-10-11 11:31:07 +02:00 committed by Dietmar Maurer
parent 9950ec0f7d
commit 5f0f6b13b5

View File

@ -15,6 +15,13 @@ Ext.define('Proxmox.data.UpdateStore', {
autoStart: false,
destroy: function() {
var me = this;
me.load_task.cancel();
Proxmox.data.UpdateQueue.unqueue(me);
me.callParent();
},
constructor: function(config) {
var me = this;
@ -59,10 +66,7 @@ Ext.define('Proxmox.data.UpdateStore', {
me.callParent([config]);
me.on('destroy', function() {
load_task.cancel();
Proxmox.data.UpdateQueue.unqueue(me);
});
me.load_task = load_task;
if (me.autoStart) {
me.startUpdate();