From 5f0f6b13b55e81203c0fc6598c0411124a493297 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Wed, 11 Oct 2017 11:31:07 +0200 Subject: [PATCH] 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 --- data/UpdateStore.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/data/UpdateStore.js b/data/UpdateStore.js index cc30bc3..4368835 100644 --- a/data/UpdateStore.js +++ b/data/UpdateStore.js @@ -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();