mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-06 16:26:52 +01:00
Fix memory leak (#7097)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user