()
| 939 | } |
| 940 | |
| 941 | destroy() { |
| 942 | this.notifyPlugins('beforeDestroy'); |
| 943 | const {canvas, ctx} = this; |
| 944 | |
| 945 | this._stop(); |
| 946 | this.config.clearCache(); |
| 947 | |
| 948 | if (canvas) { |
| 949 | this.unbindEvents(); |
| 950 | clearCanvas(canvas, ctx); |
| 951 | this.platform.releaseContext(ctx); |
| 952 | this.canvas = null; |
| 953 | this.ctx = null; |
| 954 | } |
| 955 | |
| 956 | delete instances[this.id]; |
| 957 | |
| 958 | this.notifyPlugins('afterDestroy'); |
| 959 | } |
| 960 | |
| 961 | toBase64Image(...args) { |
| 962 | return this.canvas.toDataURL(...args); |
no test coverage detected