Skip to content

Commit

Permalink
Fix memory leak (#7097)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle authored Feb 13, 2020
1 parent 25a9969 commit 72c3c6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/core.animator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/core/core.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 72c3c6d

Please sign in to comment.