Skip to content

Commit

Permalink
Fix AltStore memleak bitshares/bitshares-ui#1497
Browse files Browse the repository at this point in the history
  • Loading branch information
svk31 committed Oct 9, 2018
1 parent 0677ac2 commit b6b42ce
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/store/AltStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,13 @@ class AltStore {

unlisten(cb) {
this.lifecycle('unlisten')
this.subscriptions
.filter(subscription => subscription.cb === cb)
.forEach(subscription => subscription.dispose())
this.subscriptions = this.subscriptions.filter(subscription => {
if (subscription.cb === cb) {
subscription.dispose()
return false
}
return true
})
}

getState() {
Expand Down

0 comments on commit b6b42ce

Please sign in to comment.