Skip to content

Commit

Permalink
Release canvases on unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
hrynko committed Jun 21, 2022
1 parent 9b9df7b commit cfcb9ba
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vue-pdf-embed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ export default {
this.render()
},
beforeDestroy() {
this.$el.querySelectorAll('canvas').forEach(releaseCanvas)
this.document?.destroy()
},
beforeUnmount() {
this.$el.querySelectorAll('canvas').forEach(releaseCanvas)
this.document?.destroy()
},
methods: {
Expand Down

0 comments on commit cfcb9ba

Please sign in to comment.