From: Jukka Kurkela Date: Thu, 13 Feb 2020 23:42:25 +0000 (+0200) Subject: Fix memory leak (#7097) X-Git-Tag: v3.0.0-alpha~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72c3c6d0802919eb4d24a4ef19cc465e9fa8ff1b;p=thirdparty%2FChart.js.git Fix memory leak (#7097) --- diff --git a/src/core/core.animator.js b/src/core/core.animator.js index 28565629e..1da383039 100644 --- a/src/core/core.animator.js +++ b/src/core/core.animator.js @@ -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(); diff --git a/src/core/core.controller.js b/src/core/core.controller.js index add55549b..aca27dc75 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -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) {