Skip to content

Commit

Permalink
🐛 bug(mixin): fix memory leak
Browse files Browse the repository at this point in the history
closes #514
  • Loading branch information
kazupon committed Feb 13, 2019
1 parent a8c7316 commit 135058d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ export default class VueI18n {
Vue.config.silent = silent
}

destroyVM (): void {
this._vm.$destroy()
}

subscribeDataChanging (vm: any): void {
this._dataListeners.push(vm)
}
Expand Down
1 change: 1 addition & 0 deletions src/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export default {

if (self._i18nWatcher) {
self._i18nWatcher()
self._i18n.destroyVM()
delete self._i18nWatcher
}

Expand Down

0 comments on commit 135058d

Please sign in to comment.