[pve-devel] [PATCH manager] fix updateStore destroy

Dominik Csapak d.csapak at proxmox.com
Wed Oct 11 11:49:50 CEST 2017


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 at proxmox.com>
---
 www/manager6/data/UpdateStore.js | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/www/manager6/data/UpdateStore.js b/www/manager6/data/UpdateStore.js
index 6be36303..a8bc9efe 100644
--- a/www/manager6/data/UpdateStore.js
+++ b/www/manager6/data/UpdateStore.js
@@ -12,6 +12,13 @@ Ext.define('PVE.data.UpdateStore', {
 
     isStopped: true,
 
+    destroy: function() {
+	var me = this;
+	me.load_task.cancel();
+	PVE.data.UpdateQueue.unqueue(me);
+	me.callParent();
+    },
+
     constructor: function(config) {
 	var me = this;
 
@@ -56,9 +63,6 @@ Ext.define('PVE.data.UpdateStore', {
 
 	me.callParent([config]);
 
-	me.on('destroy', function() {
-	    load_task.cancel();
-	    PVE.data.UpdateQueue.unqueue(me);
-	});
+	me.load_task = load_task;
     }
 });
-- 
2.11.0





More information about the pve-devel mailing list