mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Fix memory leak (#7097)
This commit is contained in:
parent
25a9969489
commit
72c3c6d080
@ -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();
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user