Fix memory leak (#7097)

This commit is contained in:
Jukka Kurkela
2020-02-14 01:42:25 +02:00
committed by GitHub
parent 25a9969489
commit 72c3c6d080
2 changed files with 9 additions and 0 deletions

View File

@@ -210,6 +210,14 @@ class Animator {
anims.items = [];
this._notify(chart, anims, Date.now(), 'complete');
}
/**
* Remove chart from Animator
* @param {Chart} chart
*/
remove(chart) {
return this._charts.delete(chart);
}
}
const instance = new Animator();

View File

@@ -893,6 +893,7 @@ class Chart {
let i, ilen;
me.stop();
Animator.remove(me);
// dataset controllers need to cleanup associated data
for (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {