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) {