From 15737d22384fe25ccd7edadcd9949dbc1b6dc154 Mon Sep 17 00:00:00 2001 From: hengsin Date: Thu, 27 Oct 2022 15:09:06 +0800 Subject: [PATCH] IDEMPIERE-5457 Billboard Charts can cause memory leaks (#1544) --- .../src/metainfo/zk/lang-addon.xml | 2 +- .../src/web/js/zul/billboard/Billboard.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/org.idempiere.zk.billboard/src/metainfo/zk/lang-addon.xml b/org.idempiere.zk.billboard/src/metainfo/zk/lang-addon.xml index 778f79ffaa..25668565a0 100644 --- a/org.idempiere.zk.billboard/src/metainfo/zk/lang-addon.xml +++ b/org.idempiere.zk.billboard/src/metainfo/zk/lang-addon.xml @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/org.idempiere.zk.billboard/src/web/js/zul/billboard/Billboard.js b/org.idempiere.zk.billboard/src/web/js/zul/billboard/Billboard.js index 43adfbea33..a0f925bd38 100644 --- a/org.idempiere.zk.billboard/src/web/js/zul/billboard/Billboard.js +++ b/org.idempiere.zk.billboard/src/web/js/zul/billboard/Billboard.js @@ -34,7 +34,8 @@ timeSeries: null, timeSeriesInterval: null, timeSeriesFormat: null, - xAxisAngle: null + xAxisAngle: null, + chart: null }, _dataPrepare : function() { @@ -216,7 +217,7 @@ model.data["colors"] = colors; } } - var chart = bb.generate(model); + wgt.chart = bb.generate(model); } } }, @@ -237,6 +238,10 @@ unbind_ : function() { this.$supers(Billboard, 'unbind_', arguments); + if (this.chart) { + this.chart.destroy(); + this.chart = null; + } }, doClick_ : function(event) {