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