IDEMPIERE-5457 Billboard Charts can cause memory leaks (#1544)

This commit is contained in:
hengsin 2022-10-27 15:09:06 +08:00 committed by GitHub
parent 59b7e3c899
commit 15737d2238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -19,7 +19,7 @@
</component> </component>
<stylesheet href="~./js/zul/billboard/css/billboard.css" type="text/css"/> <stylesheet href="~./js/zul/billboard/css/billboard.css" type="text/css"/>
<javascript-module name="zul.billboard" version="3.5.1.20220908"/> <javascript-module name="zul.billboard" version="3.5.1.20221027"/>
<!-- this js module doesn't actually exists and it is here for billboard.css version --> <!-- this js module doesn't actually exists and it is here for billboard.css version -->
<javascript-module name="zul.billboard.css" version="3.5.1.20220905"/> <javascript-module name="zul.billboard.css" version="3.5.1.20220905"/>
</language-addon> </language-addon>

View File

@ -34,7 +34,8 @@
timeSeries: null, timeSeries: null,
timeSeriesInterval: null, timeSeriesInterval: null,
timeSeriesFormat: null, timeSeriesFormat: null,
xAxisAngle: null xAxisAngle: null,
chart: null
}, },
_dataPrepare : function() { _dataPrepare : function() {
@ -216,7 +217,7 @@
model.data["colors"] = colors; model.data["colors"] = colors;
} }
} }
var chart = bb.generate(model); wgt.chart = bb.generate(model);
} }
} }
}, },
@ -237,6 +238,10 @@
unbind_ : function() { unbind_ : function() {
this.$supers(Billboard, 'unbind_', arguments); this.$supers(Billboard, 'unbind_', arguments);
if (this.chart) {
this.chart.destroy();
this.chart = null;
}
}, },
doClick_ : function(event) { doClick_ : function(event) {