From 84757281e28f297cf178e6a6645be966bc94d9d7 Mon Sep 17 00:00:00 2001 From: Jacco van den Berg Date: Wed, 1 Dec 2021 20:44:09 +0100 Subject: [PATCH] remove extra line in docs, implement feedback --- docs/developers/plugins.md | 1 - src/core/core.controller.js | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/developers/plugins.md b/docs/developers/plugins.md index 4ee9e5ba517..e24cc9d82d2 100644 --- a/docs/developers/plugins.md +++ b/docs/developers/plugins.md @@ -148,7 +148,6 @@ Plugins can interact with the chart during the event handling process. The event ![Chart.js event handling flowchart](./event_flowchart.png) - ### Chart destroy Plugins are notified during the destroy process. These hooks can be used to destroy things that the plugin made and used during its life. diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 932e5c00135..01fcd0975ca 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -905,10 +905,12 @@ class Chart { this.ctx = null; } + // TODO V4: delete destroy hook and reference to it in plugin flowchart this.notifyPlugins('destroy'); - this.notifyPlugins('afterDestroy'); delete instances[this.id]; + + this.notifyPlugins('afterDestroy'); } toBase64Image(...args) {