Skip to content

Commit

Permalink
feat: destroy map on beforeDestroy to prevent memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolò Maria Mezzopera committed Jul 24, 2019
1 parent b498e96 commit 7449de0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/LMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ export default {
return options;
}
},
beforeDestroy () {
if (this.mapObject) {
this.mapObject.remove();
}
},
mounted () {
const options = optionsMerger({
minZoom: this.minZoom,
Expand Down

0 comments on commit 7449de0

Please sign in to comment.