Skip to content

Commit

Permalink
Fix cleaning up metasets
Browse files Browse the repository at this point in the history
I believe it's a mistake to only delete the metaset if it has a valid controller; see f191f2f for where this behavior was introduced.

This is a minimal fix for #9653; as discussed there, it may also be worth updating `updateHoverStyle`.

As of #7030, `this._metasets` should always be defined, so checking whether it's undefined is no longer necessary.
  • Loading branch information
joshkel committed Sep 16, 2021
1 parent 8e68481 commit adceef9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/core.controller.js
Expand Up @@ -800,12 +800,11 @@ class Chart {
* @private
*/
_destroyDatasetMeta(datasetIndex) {
const meta = this._metasets && this._metasets[datasetIndex];

const meta = this._metasets[datasetIndex];
if (meta && meta.controller) {
meta.controller._destroy();
delete this._metasets[datasetIndex];
}
delete this._metasets[datasetIndex];
}

_stop() {
Expand Down

0 comments on commit adceef9

Please sign in to comment.